diff options
-rw-r--r-- | libuuid/src/gen_uuid.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c index eb793391c..2c5b95564 100644 --- a/libuuid/src/gen_uuid.c +++ b/libuuid/src/gen_uuid.c @@ -227,6 +227,9 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, int len; int ret = 0; + if (state_fd == -1) + ret = -1; + if (state_fd == -2) { save_umask = umask(0); state_fd = open(LIBUUID_CLOCK_FILE, O_RDWR|O_CREAT|O_CLOEXEC, 0660); |