summaryrefslogtreecommitdiff
path: root/pseudo.c
diff options
context:
space:
mode:
Diffstat (limited to 'pseudo.c')
-rw-r--r--pseudo.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/pseudo.c b/pseudo.c
index 5715af2..4451992 100644
--- a/pseudo.c
+++ b/pseudo.c
@@ -343,7 +343,8 @@ main(int argc, char *argv[]) {
return pseudo_db_check(opt_B);
}
- if (opt_S) {
+ /* If you didn't specify a command, opt_S shuts down here. */
+ if (opt_S && argc <= optind) {
return pseudo_client_shutdown();
}
@@ -418,8 +419,17 @@ main(int argc, char *argv[]) {
/* try to hint that we don't think we still need
* the server.
*/
- pseudo_client_shutdown();
- return WEXITSTATUS(rc);
+ if (opt_S) {
+ pseudo_client_shutdown();
+ }
+ if (WIFEXITED(rc)) {
+ return WEXITSTATUS(rc);
+ } else if (WIFSIGNALED(rc)) {
+ kill(getpid(), WTERMSIG(rc));
+ exit(1);
+ } else {
+ exit(1);
+ }
} else {
rc = execv(fullpath, argv);
if (rc == -1) {
@@ -1067,9 +1077,10 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
msg->uid = (uid_t) -1;
msg->gid = (gid_t) -1;
#endif
- pseudo_debug(PDBGF_DB, "linking %s (uid -1 if xattr) for %s\n",
+ pseudo_debug(PDBGF_DB | PDBGF_XATTR, "linking %s (uid -1 if xattr) for %s, mode 0%o\n",
msg->pathlen ? msg->path : "no path",
- pseudo_op_name(msg->op));
+ pseudo_op_name(msg->op),
+ (int) msg->mode);
pdb_link_file(msg, &row);
}
if (pdb_set_xattr(row, oldpath, oldpathlen, xattr_flags)) {