diff options
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/shm_open.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/shm_open.c b/lib/libc/gen/shm_open.c index 02cac2f2dac..ccbe82a6c70 100644 --- a/lib/libc/gen/shm_open.c +++ b/lib/libc/gen/shm_open.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shm_open.c,v 1.2 2013/06/02 21:08:19 tedu Exp $ */ +/* $OpenBSD: shm_open.c,v 1.3 2013/10/25 19:42:18 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org> * @@ -61,13 +61,13 @@ shm_open(const char *path, int flags, mode_t mode) if (fd == -1) return -1; if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode)) { - errno = EINVAL; close(fd); + errno = EINVAL; return -1; } if (sb.st_uid != getuid()) { - errno = EPERM; close(fd); + errno = EPERM; return -1; } return fd; |