Added handling of return type

This commit is contained in:
Robert Osfield 2016-07-02 12:37:22 +01:00
parent 922c860814
commit 5beb15fa77

View File

@ -58,7 +58,10 @@ class ReaderWriterTGZ : public osgDB::ReaderWriter
strcpy(dirname, "./"); strcpy(dirname, "./");
} }
strcat(dirname, ".osgdb_tgz"); strcat(dirname, ".osgdb_tgz");
mkdir( dirname); if (mkdir( dirname)!=0)
{
return ReadResult::ERROR_IN_READING_FILE;
}
// Using tar.exe from http://www.cygwin.com/ // Using tar.exe from http://www.cygwin.com/
// tar.exe must be in your path. (PATH environment variable). // tar.exe must be in your path. (PATH environment variable).
sprintf( command, sprintf( command,
@ -68,14 +71,20 @@ class ReaderWriterTGZ : public osgDB::ReaderWriter
#if defined(__linux) || defined(__CYGWIN__) #if defined(__linux) || defined(__CYGWIN__)
sprintf( dirname, "/tmp/.tgz%06d", getpid()); sprintf( dirname, "/tmp/.tgz%06d", getpid());
mkdir( dirname, 0700 ); if (mkdir( dirname, 0700 )!=0)
{
return ReadResult::ERROR_IN_READING_FILE;
}
sprintf( command, sprintf( command,
"tar xfCz %s %s", "tar xfCz %s %s",
fileName.c_str(), dirname ); fileName.c_str(), dirname );
#endif #endif
#ifdef __sgi #ifdef __sgi
sprintf( dirname, "/tmp/.tgz%06d", getpid()); sprintf( dirname, "/tmp/.tgz%06d", getpid());
mkdir( dirname, 0700 ); if (mkdir( dirname, 0700 )!=0)
{
return ReadResult::ERROR_IN_READING_FILE;
}
sprintf( command, sprintf( command,
"cp %s %s; cd %s;" "cp %s %s; cd %s;"
"gzcat %s | tar xf -", "gzcat %s | tar xf -",