[Libsysio-commit] HEAD: libsysio/tests startup.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2006-02-08 17:17:51
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3483/tests Modified Files: startup.c Log Message: The startup code in the tests directory should process the namespace initialization variable before the initial working directory. Fixed. From ClusterFS bugzilla #10114; When compiled to support an initial working directory that is deferred until needed, a chdir to a non-existent directory would cause an abort. This behavior is per design. Not technically a bug. However, it's very unfriendly. Especially so, since the accepted thing to do in this situation is to just leave the current working directory at the root of the namespace. This change, then, alters the behavior to the commonly accepted. Index: startup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/startup.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- startup.c 3 Feb 2005 20:05:13 -0000 1.11 +++ startup.c 8 Feb 2006 17:17:43 -0000 1.12 @@ -22,22 +22,14 @@ _test_sysio_startup() if (err) return err; #if SYSIO_TRACING + /* + * tracing + */ arg = getenv("SYSIO_TRACING"); err = _sysio_boot("trace", arg); if (err) return err; #endif -#if DEFER_INIT_CWD - arg = getenv("SYSIO_CWD"); - if (!arg) - arg = "/"; - err = _sysio_boot("cwd", arg); - if (err) - return err; -#endif - /* - * tracing - */ /* * namespace */ @@ -51,6 +43,17 @@ _test_sysio_startup() err = _sysio_boot("namespace", arg); if (err) return err; +#if DEFER_INIT_CWD + /* + * Current working directory. + */ + arg = getenv("SYSIO_CWD"); + if (!arg) + arg = "/"; + err = _sysio_boot("cwd", arg); + if (err) + return err; +#endif return 0; } |