# # patch "ChangeLog" # from [83b2e191966842d4d5c5fce1b20aa82d97bd5e8d] # to [d9a38856d58db1533f87df821bf93af3fa85a631] # # patch "unix/process.cc" # from [c30edf9e74742079e4229bc8cfb0d44054e8c5c3] # to [120cb09130df0f1a2acd085b79ed7edeff5e3b82] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,9 @@ 2005-06-24 Nathaniel Smith + * unix/process.cc: Remove tabs. + +2005-06-24 Nathaniel Smith + * std_hooks.lua (get_preferred_merge2_command) (get_preferred_merge3_command): Move meld to the bottom of the default merge tool search order. Also, use xemacs if it appears --- unix/process.cc +++ unix/process.cc @@ -16,88 +16,88 @@ int existsonpath(const char *exe) { - const char * const args[3] = {"which", exe, NULL}; - int pid; - int res; - pid = process_spawn(args); - if (pid==-1) - return -1; - if (process_wait(pid, &res)) - return -1; - if (res==0) - return 0; - return -1; + const char * const args[3] = {"which", exe, NULL}; + int pid; + int res; + pid = process_spawn(args); + if (pid==-1) + return -1; + if (process_wait(pid, &res)) + return -1; + if (res==0) + return 0; + return -1; } bool is_executable(const char *path) { - struct stat s; + struct stat s; - int rc = stat(path, &s); - N(rc != -1, F("stat() error on file %s)") % path); + int rc = stat(path, &s); + N(rc != -1, F("stat() error on file %s)") % path); - return s.st_mode & S_IXUSR; + return s.st_mode & S_IXUSR; } int make_executable(const char *path) { - mode_t mode; - struct stat s; - if (stat(path, &s)) - return -1; - mode = s.st_mode; - mode |= S_IXUSR; - return chmod(path, mode); + mode_t mode; + struct stat s; + if (stat(path, &s)) + return -1; + mode = s.st_mode; + mode |= S_IXUSR; + return chmod(path, mode); } pid_t process_spawn(const char * const argv[]) { - { - std::ostringstream cmdline_ss; - for (const char *const *i = argv; *i; ++i) - { - if (i) - cmdline_ss << ", "; - cmdline_ss << "'" << *i << "'"; - } - L(F("spawning command: %s\n") % cmdline_ss.str()); - } - pid_t pid; - pid = fork(); - switch (pid) - { - case -1: /* Error */ - return -1; - case 0: /* Child */ - execvp(argv[0], (char * const *)argv); - return -1; - default: /* Parent */ - return pid; - } + { + std::ostringstream cmdline_ss; + for (const char *const *i = argv; *i; ++i) + { + if (i) + cmdline_ss << ", "; + cmdline_ss << "'" << *i << "'"; + } + L(F("spawning command: %s\n") % cmdline_ss.str()); + } + pid_t pid; + pid = fork(); + switch (pid) + { + case -1: /* Error */ + return -1; + case 0: /* Child */ + execvp(argv[0], (char * const *)argv); + return -1; + default: /* Parent */ + return pid; + } } int process_wait(pid_t pid, int *res) { - int status; - pid = waitpid(pid, &status, 0); - if (WIFEXITED(status)) - *res = WEXITSTATUS(status); - else - *res = -1; - return 0; + int status; + pid = waitpid(pid, &status, 0); + if (WIFEXITED(status)) + *res = WEXITSTATUS(status); + else + *res = -1; + return 0; } int process_kill(pid_t pid, int signal) { - return kill(pid, signal); + return kill(pid, signal); } int process_sleep(unsigned int seconds) { - return sleep(seconds); + return sleep(seconds); } pid_t get_process_id() { - return getpid(); + return getpid(); }