Strange Problem calling chdir()

gregory.menke at gsfc.nasa.gov gregory.menke at gsfc.nasa.gov
Mon Dec 30 16:06:53 UTC 2002


Peter Mueller writes:
 > -----BEGIN PGP SIGNED MESSAGE-----
 > Hash: SHA1
 > 
 > Hello all,
 > 
 > I have a strange problem with the code shown below. In dummyHMI::test()
 > argc/argv are in reality built from commands/parameters I get from a
 > serial line. The problem is that the name holds "test" as expected in
 > dummyClient::printdir(), but is empty in chdir().
 > 

Barring some subtle bug, my guess is the chdir() is being optimized
away since you're not doing anything with res.  Try declaring res,
then assigning chdir's return value to it on a separate line.

Gregm




More information about the users mailing list