Use MEDIT_PID environment variable in addition to --pid option

This commit is contained in:
Yevgen Muntyan 2006-08-22 23:25:08 -05:00
parent 4e6a5cd89f
commit 4aecb63ebb
2 changed files with 16 additions and 4 deletions

View File

@ -464,6 +464,7 @@ main (int argc, char *argv[])
AppMode mode = MODE_SIMPLE;
guint32 stamp;
int line = -1;
const char *pid_string = NULL;
gtk_init (&argc, &argv);
stamp = TIMESTAMP;
@ -514,14 +515,19 @@ main (int argc, char *argv[])
line = strtol (_medit_arg_line, NULL, 10);
if (_medit_opt_pid)
pid_string = _medit_arg_pid;
else if (!_medit_opt_new_app)
pid_string = g_getenv ("MEDIT_PID");
if (pid_string)
{
if (moo_app_send_files (app, files, stamp, _medit_arg_pid))
if (moo_app_send_files (app, files, stamp, pid_string))
{
exit (0);
}
else
{
g_print ("Could not send files to pid %s\n", _medit_arg_pid);
g_print ("Could not send files to pid %s\n", pid_string);
exit (1);
}
}

View File

@ -151,6 +151,7 @@ main (int argc, char *argv[])
AppMode mode = MODE_SIMPLE;
guint32 stamp;
int line = -1;
const char *pid_string = NULL;
gtk_init (&argc, &argv);
stamp = TIMESTAMP;
@ -201,14 +202,19 @@ main (int argc, char *argv[])
line = strtol (_medit_arg_line, NULL, 10);
if (_medit_opt_pid)
pid_string = _medit_arg_pid;
else if (!_medit_opt_new_app)
pid_string = g_getenv ("MEDIT_PID");
if (pid_string)
{
if (moo_app_send_files (app, files, stamp, _medit_arg_pid))
if (moo_app_send_files (app, files, stamp, pid_string))
{
exit (0);
}
else
{
g_print ("Could not send files to pid %s\n", _medit_arg_pid);
g_print ("Could not send files to pid %s\n", pid_string);
exit (1);
}
}