Return file descriptor on success, not 1. --HG-- branch : HEAD
diff --git a/lib/mkstemp.c b/lib/mkstemp.c index ccb1b5b..ba68860 100644 --- a/lib/mkstemp.c +++ b/lib/mkstemp.c
@@ -1,4 +1,4 @@ -/* $NiH: mkstemp.c,v 1.2 2006/02/22 19:52:20 dillo Exp $ */ +/* $NiH: mkstemp.c,v 1.3 2006/04/23 14:51:45 wiz Exp $ */ /* Adapted from NetBSB libc by Dieter Baron */ @@ -111,7 +111,7 @@ for (;;) { if ((fd = open(path, O_CREAT | O_EXCL | O_RDWR, 0600)) >= 0) - return (1); + return (fd); if (errno != EEXIST) return (0);