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

Diff of /trunk/libsbutil/get_sandbox_lib.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 280 Revision 281
27{ 27{
28#ifdef SB_HAVE_MULTILIB 28#ifdef SB_HAVE_MULTILIB
29 snprintf(path, SB_PATH_MAX, "%s", LIB_NAME); 29 snprintf(path, SB_PATH_MAX, "%s", LIB_NAME);
30#else 30#else
31 snprintf(path, SB_PATH_MAX, "%s/%s", LIBSANDBOX_PATH, LIB_NAME); 31 snprintf(path, SB_PATH_MAX, "%s/%s", LIBSANDBOX_PATH, LIB_NAME);
32# ifdef OUTSIDE_LIBSANDBOX
33 if (0 >= rc_file_exists(path)) {
34# else
32 if (0 >= exists(path)) { 35 if (0 >= exists(path)) {
36# endif
33 snprintf(path, SB_PATH_MAX, "%s", LIB_NAME); 37 snprintf(path, SB_PATH_MAX, "%s", LIB_NAME);
34 } 38 }
35#endif 39#endif
36} 40}
37 41
130 return FALSE; 134 return FALSE;
131} 135}
132 136
133#ifndef OUTSIDE_LIBSANDBOX 137#ifndef OUTSIDE_LIBSANDBOX
134 138
139int exists(const char *pathname)
140{
141 struct stat buf;
142 int retval;
143
144 if ((NULL == pathname) || (0 == strlen(pathname)))
145 return 0;
146
147 retval = lstat(pathname, &buf);
148 if (-1 != retval)
149 return 1;
150 /* Some or other error occurred */
151 if (ENOENT != errno)
152 return -1;
153
154 return 0;
155}
156
135char * gstrndup (const char *str, size_t size) 157char * gstrndup (const char *str, size_t size)
136{ 158{
137 char *new_str = NULL; 159 char *new_str = NULL;
138 size_t len; 160 size_t len;
139 161

Legend:
Removed from v.280  
changed lines
  Added in v.281

  ViewVC Help
Powered by ViewVC 1.1.20