From 7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de Mon Sep 17 00:00:00 2001 From: bigbiff Date: Thu, 1 Jan 2015 19:44:14 -0500 Subject: Update blkid to 2.25.0 Break libblkid into 4 libraries: libblkid, libuuid, libutil-linux and libfdisk. This should help in later patch updates. Change-Id: I680d9a7feb031e5c29a603e9c58aff4b65826262 --- libblkid/fileutils.c | 84 ---------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 libblkid/fileutils.c (limited to 'libblkid/fileutils.c') diff --git a/libblkid/fileutils.c b/libblkid/fileutils.c deleted file mode 100644 index ebfb12857..000000000 --- a/libblkid/fileutils.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2012 Sami Kerola - */ - -#include -#include -#include -#include -#include -#include - -#include "c.h" -#include "fileutils.h" -#include "pathnames.h" -#include "xalloc.h" - -#define _PATH_TMP "/tmp" -/* Create open temporary file in safe way. Please notice that the - * file permissions are -rw------- by default. */ -int xmkstemp(char **tmpname, char *dir) -{ - char *localtmp; - char *tmpenv; - mode_t old_mode; - int fd; - - /* Some use cases must be capable of being moved atomically - * with rename(2), which is the reason why dir is here. */ - if (dir != NULL) - tmpenv = dir; - else - tmpenv = getenv("TMPDIR"); - - if (tmpenv) - xasprintf(&localtmp, "%s/%s.XXXXXX", tmpenv, - program_invocation_short_name); - else - xasprintf(&localtmp, "%s/%s.XXXXXX", _PATH_TMP, - program_invocation_short_name); - old_mode = umask(077); - fd = mkstemp(localtmp); - umask(old_mode); - if (fd == -1) { - free(localtmp); - localtmp = NULL; - } - *tmpname = localtmp; - return fd; -} - -/* - * portable getdtablesize() - */ -int get_fd_tabsize(void) -{ - int m; - -#if defined(HAVE_GETDTABLESIZE) - m = getdtablesize(); -#elif defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) - struct rlimit rl; - - getrlimit(RLIMIT_NOFILE, &rl); - m = rl.rlim_cur; -#elif defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX) - m = sysconf(_SC_OPEN_MAX); -#else - m = OPEN_MAX; -#endif - return m; -} - -#ifdef TEST_PROGRAM -int main(void) -{ - FILE *f; - char *tmpname; - f = xfmkstemp(&tmpname, NULL); - unlink(tmpname); - free(tmpname); - fclose(f); - return EXIT_FAILURE; -} -#endif -- cgit v1.2.3