]> git.pld-linux.org Git - packages/util-linux.git/commitdiff
- fixed and improved mkostemp replacement, still uses mktemp so it stinks auto/th/util-linux-2_19-1
authorsparky <sparky@pld-linux.org>
Fri, 11 Feb 2011 00:17:20 +0000 (00:17 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    util-linux-diet.patch -> 1.2

util-linux-diet.patch

index e5c2d25e3b7296051571f9aba8a5024c55ef8afa..959267421d9e85f1d5cbf46d74ccc8e94f2e9800 100644 (file)
        if (rc <= 0)
                return -errno;
  
-+#ifndef HAVE_MKOSTEMP
-+      if ( mktemp( n ) == NULL ) {
++#ifdef HAVE_MKOSTEMP
+       fd = mkostemp(n, flags | O_EXCL);
++#else
++      if ( mktemp(n) == NULL || n[0] == '\0' ) {
 +              free(n);
 +              return -errno;
 +      }
-+      fd = open(n, flags | O_EXCL);
-+#else
-       fd = mkostemp(n, flags | O_EXCL);
++      fd = open(n, flags | O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
 +#endif
        if (fd >= 0 && name)
                *name = n;
This page took 0.121049 seconds and 4 git commands to generate.