[Libsysio-commit] HEAD: libsysio/tests startup.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-08-09 15:33:12
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21795 Modified Files: startup.c Log Message: If SYSIO_CWD is set in the environment, the internal current working directory will be set to the value. Index: startup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/startup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- startup.c 3 Jul 2004 05:52:07 -0000 1.5 +++ startup.c 9 Aug 2004 15:33:03 -0000 1.6 @@ -23,14 +23,24 @@ _test_sysio_startup() return err; s = getenv("SYSIO_NAMESPACE"); if (s) - return _sysio_boot(s); - s = getenv("SYSIO_MANUAL"); - if (s) - return 0; + err = _sysio_boot(s); + else if (!(s = getenv("SYSIO_MANUAL"))) { /* * Assume a native mount at root. */ - return _sysio_boot("{mnt,dev=\"native:/\",dir=/,fl=0}"); + err = _sysio_boot("{mnt,dev=\"native:/\",dir=/,fl=0}"); + } + if (err) + return err; + + s = getenv("SYSIO_CWD"); + if (s) { + err = chdir(s); + if (err) + return err; + } + + return 0; } void |