From: Lennart Poettering Date: Fri, 8 Oct 2010 16:22:28 +0000 (+0200) Subject: util: don't specifically check for the /dev/null major/minor, just check whether... X-Git-Tag: v12~256 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=c8f26f42e2c81d03ff6e845afa12eb3432e794b8 util: don't specifically check for the /dev/null major/minor, just check whether something is a char or block device --- diff --git a/src/util.c b/src/util.c index 12c19b353..d09e44777 100644 --- a/src/util.c +++ b/src/util.c @@ -3319,10 +3319,7 @@ bool null_or_empty(struct stat *st) { if (S_ISREG(st->st_mode) && st->st_size <= 0) return true; - /* /dev/null has major/minor of 1:3 */ - if (S_ISCHR(st->st_mode) && - major(st->st_rdev) == 1 && - minor(st->st_rdev) == 3) + if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) return true; return false;