# # patch "ChangeLog" # from [5f70c813a76cb64a0247ff1598f88a86a82db370] # to [2c6040edaf0ca83ca5b2ddd9f6ff3e39be3c8bce] # # patch "unix/process.cc" # from [16c179fb6b07c6587fb588a2a83a9d102406798b] # to [f29013c6954e3254d58e2fe6681c9cbd723ba45f] # ======================================================================== --- ChangeLog 5f70c813a76cb64a0247ff1598f88a86a82db370 +++ ChangeLog 2c6040edaf0ca83ca5b2ddd9f6ff3e39be3c8bce @@ -1,5 +1,10 @@ 2005-08-17 Nathaniel Smith + * unix/process.cc (is_executable, make_executable): When reporting + an error in a syscall, include the actual error message. + +2005-08-17 Nathaniel Smith + * lua.cc (dump_stack): New function. (Lua::fail): New method; use above. (get, get_fn, get_tab, get_str, get_num, get_bool, extract_str) ======================================================================== --- unix/process.cc 16c179fb6b07c6587fb588a2a83a9d102406798b +++ unix/process.cc f29013c6954e3254d58e2fe6681c9cbd723ba45f @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -48,7 +49,7 @@ struct stat s; int rc = stat(path, &s); - N(rc != -1, F("stat() error on file %s") % path); + N(rc != -1, F("error getting status of file %s: %s") % path % strerror(errno)); return s.st_mode & S_IXUSR; } @@ -57,15 +58,15 @@ { mode_t mode; struct stat s; - int fd = open(path, O_RDWR); - N(fd != -1, F("open() error on file %s") % path); + int fd = open(path, O_RDWR); + N(fd != -1, F("error opening file %s: %s") % path % strerror(errno)); if (fstat(fd, &s)) - return -1; + return -1; mode = s.st_mode; mode |= S_IXUSR|S_IXGRP|S_IXOTH; int ret = fchmod(fd, mode); - N(close(fd) == 0, F("close() error on file %s") % path); - return ret; + N(close(fd) == 0, F("error closing file %s: %s") % path % strerror(errno)); + return ret; } pid_t process_spawn(const char * const argv[])