From: Lennart Poettering Date: Thu, 6 Nov 2014 20:20:32 +0000 (+0100) Subject: copy: change error code when hitting copy limit to EFBIG X-Git-Tag: v218~511 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=84ee0960443b795936026239f8c0ff8429aed699;p=elogind.git copy: change error code when hitting copy limit to EFBIG After all, this is about files, not arguments, hence EFBIG is more appropriate than E2BIG --- diff --git a/src/journal/coredump.c b/src/journal/coredump.c index f423fa2a2..26a201077 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -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)) { diff --git a/src/shared/copy.c b/src/shared/copy.c index a863246b2..abb7fbc52 100644 --- a/src/shared/copy.c +++ b/src/shared/copy.c @@ -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;