/[path-sandbox]/trunk/libsbutil/get_tmp_dir.c
Gentoo

Contents of /trunk/libsbutil/get_tmp_dir.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 370 - (show annotations) (download) (as text)
Sun Nov 9 10:29:58 2008 UTC (6 years, 1 month ago) by vapier
File MIME type: text/x-csrc
File size: 539 byte(s)
consolidate all random system includes into headers.h
1 /*
2 * get_tmp_dir.c
3 *
4 * Util functions.
5 *
6 * Copyright 1999-2008 Gentoo Foundation
7 * Licensed under the GPL-2
8 *
9 * Some parts might have Copyright:
10 * Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>
11 */
12
13 #include "headers.h"
14 #include "sbutil.h"
15
16 int get_tmp_dir(char *path)
17 {
18 save_errno();
19
20 if (NULL == realpath(getenv(ENV_TMPDIR) ? getenv(ENV_TMPDIR)
21 : TMPDIR,
22 path)) {
23 if (NULL == realpath(TMPDIR, path))
24 return -1;
25 }
26
27 /* Reset errno in case realpath set it */
28 restore_errno();
29
30 return 0;
31 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20