diff -r 67c519bcb997 -r 0be839ffa2a5 src/sim/process.hh --- a/src/sim/process.hh Thu Apr 09 15:50:29 2015 -0500 +++ b/src/sim/process.hh Thu Apr 09 15:52:54 2015 -0500 @@ -189,7 +189,7 @@ void dup_fd(int sim_fd, int tgt_fd); // generate new target fd for sim_fd - int alloc_fd(int sim_fd, std::string filename, int flags, int mode, + int alloc_fd(int sim_fd, const std::string& filename, int flags, int mode, bool pipe); // free target fd (e.g., after close) diff -r 67c519bcb997 -r 0be839ffa2a5 src/sim/process.cc --- a/src/sim/process.cc Thu Apr 09 15:50:29 2015 -0500 +++ b/src/sim/process.cc Thu Apr 09 15:52:54 2015 -0500 @@ -272,7 +272,8 @@ // generate new target fd for sim_fd int -Process::alloc_fd(int sim_fd, string filename, int flags, int mode, bool pipe) +Process::alloc_fd(int sim_fd, const string& filename, int flags, int mode, + bool pipe) { // in case open() returns an error, don't allocate a new fd if (sim_fd == -1) @@ -384,7 +385,7 @@ if (in == "stdin" || in == "cin") stdin_fd = STDIN_FILENO; - else if (in == "None") + else if (in == "NULL") stdin_fd = -1; else { // open standard in and seek to the right location @@ -397,7 +398,7 @@ stdout_fd = STDOUT_FILENO; else if (out == "stderr" || out == "cerr") stdout_fd = STDERR_FILENO; - else if (out == "None") + else if (out == "NULL") stdout_fd = -1; else { stdout_fd = Process::openOutputFile(out); @@ -409,7 +410,7 @@ stderr_fd = STDOUT_FILENO; else if (err == "stderr" || err == "cerr") stderr_fd = STDERR_FILENO; - else if (err == "None") + else if (err == "NULL") stderr_fd = -1; else if (err == out) stderr_fd = stdout_fd; @@ -456,7 +457,7 @@ fdo->fd = fd; //Seek to correct location before checkpoint - if (lseek(fd,fdo->fileOffset, SEEK_SET) < 0) + if (lseek(fd, fdo->fileOffset, SEEK_SET) < 0) panic("Unable to seek to correct location in file: %s", fdo->filename); } @@ -472,8 +473,8 @@ if (fdo->fd != -1) { fdo->fileOffset = lseek(fdo->fd, 0, SEEK_CUR); } else { - fdo->filename = "NULL"; - fdo->fileOffset = 0; + fdo->filename = "NULL"; + fdo->fileOffset = 0; } } }