From: Karel Zak Date: Wed, 3 Apr 2013 14:13:45 +0000 (+0200) Subject: libfdisk: use O_CLOEXEC X-Git-Tag: v2.23-rc2~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=065070f216d27ae09d27172509fe03d192fd9b15;p=thirdparty%2Futil-linux.git libfdisk: use O_CLOEXEC Signed-off-by: Karel Zak --- diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c index da2d5588aa..c9613926ca 100644 --- a/libfdisk/src/context.c +++ b/libfdisk/src/context.c @@ -158,8 +158,8 @@ int fdisk_context_assign_device(struct fdisk_context *cxt, reset_context(cxt); - if (readonly == 1 || (fd = open(fname, O_RDWR)) < 0) { - if ((fd = open(fname, O_RDONLY)) < 0) + if (readonly == 1 || (fd = open(fname, O_RDWR|O_CLOEXEC)) < 0) { + if ((fd = open(fname, O_RDONLY|O_CLOEXEC)) < 0) return -errno; readonly = 1; }