diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2006-07-13 15:41:48 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2006-07-13 15:41:48 +0000 |
commit | c221795fea5519bcbab33836da0e0bd099850e9f (patch) | |
tree | 4877c281b4922a9af93b5c3817020ef7dd5cb52b /libsbutil/get_sandbox_lib.c | |
parent | Add back using libsbutil.a, else libsandbox.so increase currently with at lea... (diff) | |
download | sandbox-c221795fea5519bcbab33836da0e0bd099850e9f.tar.gz sandbox-c221795fea5519bcbab33836da0e0bd099850e9f.tar.bz2 sandbox-c221795fea5519bcbab33836da0e0bd099850e9f.zip |
Split out util functions.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
Diffstat (limited to 'libsbutil/get_sandbox_lib.c')
-rw-r--r-- | libsbutil/get_sandbox_lib.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libsbutil/get_sandbox_lib.c b/libsbutil/get_sandbox_lib.c new file mode 100644 index 0000000..e93c5c9 --- /dev/null +++ b/libsbutil/get_sandbox_lib.c @@ -0,0 +1,48 @@ +/* + * get_sandbox_lib.c + * + * Util functions. + * + * Copyright 1999-2006 Gentoo Foundation + * + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Some parts might have Copyright: + * + * Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com> + * + * $Header$ + */ + + +#include <errno.h> +#include <stdio.h> + +#include "sbutil.h" + +void get_sandbox_lib(char *path) +{ + save_errno(); +#ifdef SB_HAVE_MULTILIB + snprintf(path, SB_PATH_MAX, "%s", LIB_NAME); +#else + snprintf(path, SB_PATH_MAX, "%s/%s", LIBSANDBOX_PATH, LIB_NAME); + if (!rc_file_exists(path)) { + snprintf(path, SB_PATH_MAX, "%s", LIB_NAME); + } +#endif + restore_errno(); +} + |