#ifdef HAVE_PUTENV
if (daemon_connection)
set_env_num("RSYNC_PORT", env_port);
+#else
+ (void)env_port;
#endif
pid = do_cmd(shell_cmd, shell_machine, shell_user, remote_argv, remote_argc, &f_in, &f_out);
#endif
}
-
/**
* This routine catches signals and tries to send them to gdb.
*
return "xterm -display :0 -T Panic -n Panic -e gdb /proc/%d/exe %d";
}
-
/**
* Handle a fatal signal by launching a debugger, controlled by $RSYNC_PANIC_ACTION.
*
}
#endif
+static void unset_env_var(const char *var)
+{
+#ifdef HAVE_UNSETENV
+ unsetenv(var);
+#else
+#ifdef HAVE_PUTENV
+ char *mem;
+ if (asprintf(&mem, "%s=", var) < 0)
+ out_of_memory("unset_env_var");
+ putenv(mem);
+#else
+ (void)var;
+#endif
+#endif
+}
+
int main(int argc,char *argv[])
{
our_gid = MY_GID();
am_root = our_uid == ROOT_UID;
+ unset_env_var("DISPLAY");
+
memset(&stats, 0, sizeof(stats));
/* Even a non-daemon runs needs the default config values to be set, e.g.