X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lib%2Fet%2Ferror_message.c;h=bd18be781633473768d2e726eb91b54436c0e5a3;hb=038e5385866a507726965a667fa0c7ef0497a9c2;hp=5dd8aa6581d6dfa26c1adb42b1accb16c1f3e1fa;hpb=ce4615dd5709638a1f26e6cd59ebf880d5b8864d;p=tools%2Fe2fsprogs.git diff --git a/lib/et/error_message.c b/lib/et/error_message.c index 5dd8aa6..bd18be7 100644 --- a/lib/et/error_message.c +++ b/lib/et/error_message.c @@ -257,7 +257,14 @@ static void init_debug(void) if (fd >= 0) { flags = fcntl(fd, F_GETFD); if (flags >= 0) - fcntl(fd, F_SETFD, flags | FD_CLOEXEC); + flags = fcntl(fd, F_SETFD, flags | FD_CLOEXEC); + if (flags < 0) { + fprintf(debug_f, "Couldn't set FD_CLOEXEC " + "on debug FILE: %s\n", strerror(errno)); + fclose(debug_f); + debug_f = NULL; + debug_mask = DEBUG_INIT; + } } #endif } else