From b5819fbc96f87c353b04aa75daa14a483bc6d8ce Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Oct 2023 20:25:42 +0300 Subject: [PATCH] BRUH --- coreutils/cp.c | 7 +++++-- tst/pst/test | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 tst/pst/test diff --git a/coreutils/cp.c b/coreutils/cp.c index a442ac5..b3d8e7e 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -89,14 +89,17 @@ int cptree(const char *src, const char *dst) { if (S_ISDIR(stat_path.st_mode) == 0) { if (copy(src, dst)) { fprintf(stderr, "cp: %s: is not directory\n", src); - return -1; + return 1; } return 0; } else { - mkdir(dst, 0777); + if (mkdir(dst, 0777) < 0) { + fprintf(stderr, "cp: %s\n", strerror(errno)); + return 1; + } } DIR *dir = opendir(src); diff --git a/tst/pst/test b/tst/pst/test deleted file mode 100644 index 1381bd7..0000000 --- a/tst/pst/test +++ /dev/null @@ -1 +0,0 @@ -hshshs