]> git.pld-linux.org Git - packages/bopm.git/blob - bopm-conf-cmd.diff
- release 4
[packages/bopm.git] / bopm-conf-cmd.diff
1 Index: main.c
2 ===================================================================
3 RCS file: /data/cvs/bopm/src/main.c,v
4 retrieving revision 1.18
5 diff -u -r1.18 main.c
6 --- main.c      22 Jun 2003 13:19:39 -0000      1.18
7 +++ main.c      3 Sep 2006 20:11:46 -0000
8 @@ -206,6 +206,8 @@
9        /* Restart bopm if main_restart() was called (usually happens by m_kill in irc.c) */
10        if(RESTART)
11        {
12 +         char *args[] = { "-c", CONFNAME, 0 };
13 +
14           /* If restarted in debug mode, die */
15           if(OPT_DEBUG)
16              return(1); 
17 @@ -224,7 +226,7 @@
18              fcntl(i, F_SETFD, FD_CLOEXEC);
19  
20           /* execute new process */
21 -         if(execve(argv[0], argv, NULL) == -1)
22 +         if(execve(argv[0], args, NULL) == -1)
23              log_printf("MAIN RESTART -> Execution of \"%s\" failed. ERROR: %s", argv[0], strerror(errno));
24  
25           /* Should only get here if execve failed */
26 Index: opercmd.c
27 ===================================================================
28 RCS file: /data/cvs/bopm/src/opercmd.c,v
29 retrieving revision 1.12
30 diff -u -r1.12 opercmd.c
31 --- opercmd.c   25 Oct 2004 05:21:05 -0000      1.12
32 +++ opercmd.c   3 Sep 2006 20:11:46 -0000
33 @@ -54,6 +54,7 @@
34  static void cmd_check(char *, char *, struct ChannelConf *);
35  static void cmd_stat(char *, char *, struct ChannelConf *);
36  static void cmd_fdstat(char *, char *, struct ChannelConf *);
37 +static void cmd_conf(char *, char *, struct ChannelConf *);
38  #if 0
39  static void cmd_op(char *, char *, struct ChannelConf *);
40  #endif
41 @@ -67,6 +68,7 @@
42        {"STATUS", cmd_stat   },
43        {"FDSTAT", cmd_fdstat },
44  /*    {"OP",     cmd_op     } */
45 +      {"CONF",   cmd_conf   },
46     };
47  
48  
49 @@ -412,3 +414,16 @@
50     USE_VAR(source);
51  }
52  #endif
53 +extern char *CONFNAME;
54 +
55 +static void cmd_conf(char *param, char *source, struct ChannelConf *target)
56 +{
57 +   USE_VAR(source);
58 +
59 +   if(strlen(param)
60 +         && strlen(param) == strspn(param, "abcdefghijklmnopqrstuvwxyz"))
61 +   {
62 +      CONFNAME = DupString(param);
63 +      main_restart();
64 +   }
65 +}
This page took 0.077053 seconds and 3 git commands to generate.