]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: add _PATH_TMP fallback
authorKarel Zak <kzak@redhat.com>
Mon, 13 Jan 2020 09:45:35 +0000 (10:45 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Jan 2020 09:49:44 +0000 (10:49 +0100)
- cleanup header of the file
- fix fileutils.c warnings
- add _PATH_TMP fallback

Addresses: https://github.com/karelzak/util-linux/issues/931
Signed-off-by: Karel Zak <kzak@redhat.com>
include/pathnames.h
lib/strutils.c

index ae098036989af3b121a2da562563a039cf7ee43a..97815e5f35124d1d496199a959576be50857825c 100644 (file)
@@ -1,7 +1,6 @@
 /*
- * Vaguely based on
- *     @(#)pathnames.h 5.3 (Berkeley) 5/9/89
- * This code is in the public domain.
+ * No copyright is claimed.  This code is in the public domain; do with
+ * it what you wish.
  */
 #ifndef PATHNAMES_H
 #define PATHNAMES_H
 #define _PATH_SHADOW_PASSWD    "/etc/shadow"
 #define _PATH_SHELLS           "/etc/shells"
 
+#ifndef _PATH_TMP
+# define _PATH_TMP             "/tmp/"
+#endif
+
 #ifndef _PATH_BTMP
 # define _PATH_BTMP            "/var/log/btmp"
 #endif
index 6e013f3a1a55ff9a5d06f38839b4a44e83de2d6e..84d2a1d7b11b5ea9dbcf80fbdd7d9e6541e1e91d 100644 (file)
@@ -18,6 +18,7 @@
 #include "nls.h"
 #include "strutils.h"
 #include "bitops.h"
+#include "pathnames.h"
 
 static int STRTOXX_EXIT_CODE = EXIT_FAILURE;
 
@@ -1013,6 +1014,7 @@ int skip_fline(FILE *fp)
 }
 
 #ifdef TEST_PROGRAM_STRUTILS
+#include <stdio.h>
 
 static int test_strutils_sizes(int argc, char *argv[])
 {