1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-09 01:18:39 +03:00

libdevmapper, dmeventd: be paranoid about detecting write failure

* dmeventd/dmeventd.c (_set_oom_adj): When writing to /proc/self/oom_adj,
detect failure even if it's hidden behind ferror.  [Using dm_fclose's
extra ferror test here is probably not needed, since the amount written
is nowhere near BUFSIZ, but use it regardless, for consistency. ]
* lib/fs/libdevmapper.c (do_suspend): Detect fclose failure when
writing to suspend.
This commit is contained in:
Jim Meyering 2007-07-24 14:16:48 +00:00
parent b14b97599d
commit 6fa6ce35da
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
Version 1.02.22 -
================================
dm_fclose: new function
libdevmapper, dmeventd: be paranoid about detecting write failure
Version 1.02.21 - 13th July 2007
================================

View File

@ -1579,7 +1579,7 @@ static int _set_oom_adj(int val)
}
fprintf(fp, "%i", val);
if (fclose(fp))
if (dm_fclose(fp))
perror(OOM_ADJ_FILE ": fclose failed");
return 1;