From: Daniel Hokka Zakrisson Date: Mon, 25 Aug 2008 21:11:32 +0000 (+0000) Subject: If /proc/sys is inaccessible, assume there are no settings. X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e5c1daf8cff3a0d6a4a81b56bf4cc4f32d25513;p=util-vserver.git If /proc/sys is inaccessible, assume there are no settings. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2773 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/src/vsysctl.c b/src/vsysctl.c index ca022a1..c5bca13 100644 --- a/src/vsysctl.c +++ b/src/vsysctl.c @@ -157,7 +157,8 @@ int main(int argc, char *argv[]) DIR *dp; struct dirent *de; - Echdir(PROC_SYS_DIRECTORY); + if (chdir(PROC_SYS_DIRECTORY) == -1) + goto exec; dp = opendir(dir); if (dp != NULL) { @@ -176,6 +177,7 @@ int main(int argc, char *argv[]) Efchdir(curdir); } +exec: Eexecvp(argv[optind], argv+optind); return EXIT_FAILURE; }