chiark / gitweb /
copy: change error code when hitting copy limit to EFBIG
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Nov 2014 20:20:32 +0000 (21:20 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Nov 2014 00:19:56 +0000 (01:19 +0100)
After all, this is about files, not arguments, hence EFBIG is more
appropriate than E2BIG

src/journal/coredump.c
src/shared/copy.c

index f423fa2a29c8f8fa03362e5c97bbdfd31ae4c8b5..26a201077290f50afc5559d382d00c88d16c95f6 100644 (file)
@@ -329,7 +329,7 @@ static int save_external_coredump(
         }
 
         r = copy_bytes(STDIN_FILENO, fd, arg_process_size_max);
-        if (r == -E2BIG) {
+        if (r == -EFBIG) {
                 log_error("Coredump of %s (%s) is larger than configured processing limit, refusing.", info[INFO_PID], info[INFO_COMM]);
                 goto fail;
         } else if (IN_SET(r, -EDQUOT, -ENOSPC)) {
index a863246b2bf47c5ed821f2603f8ddb9f0ea3c38a..abb7fbc52b7bdbda65bd3defeb1331770ef7ba0c 100644 (file)
@@ -37,7 +37,7 @@ int copy_bytes(int fdf, int fdt, off_t max_bytes) {
                 if (max_bytes != (off_t) -1) {
 
                         if (max_bytes <= 0)
-                                return -E2BIG;
+                                return -EFBIG;
 
                         if ((off_t) m > max_bytes)
                                 m = (size_t) max_bytes;