Masanobu Yasui authored on 2009/06/12 03:08:58
Showing 1 changed files
... ...
@@ -261,12 +261,12 @@ int mexec_open(int l, mcomm *c, int n)
261 261
     return(0);
262 262
   }
263 263
   if(c->logflag){
264
-    lprintf(1, "%d>-----------------------\n", c->no);
265
-    lprintf(1, "%d> %s\n", c->no, c->cmdline[n]);
264
+    lprintf(l, "%d>-----------------------\n", c->no);
265
+    lprintf(l, "%d> %s\n", c->no, c->cmdline[n]);
266 266
   }else{
267 267
     if(l <= moption.loglevel){
268
-      lprintf(1, "%d>======= connect =======\n", c->no);
269
-      lprintf(1, "%d> %s\n", c->no, c->cmdline[n]);
268
+      lprintf(l, "%d>======= connect =======\n", c->no);
269
+      lprintf(l, "%d> %s\n", c->no, c->cmdline[n]);
270 270
       c->logflag = 1;
271 271
     }
272 272
   }
... ...
@@ -314,6 +314,10 @@ int mexec_close(mcomm *c, int n)
314 314
 
315 315
 int mexec_quit(mcomm *c, int n)
316 316
 {
317
+  if(c->logflag){
318
+    lprintf(1, "%d>-----------------------\n", c->no);
319
+    lprintf(1, "%d> %s\n", c->no, c->cmdline[n]);
320
+  }
317 321
   mexec_close(c, n);
318 322
   return(0);
319 323
 }
... ...
@@ -1138,15 +1142,12 @@ int mexec(mcomm *c, int n)
1138 1138
       return(mexec_help(c, n));
1139 1139
     }
1140 1140
     if(!strcmp("quit", command_list[r])){
1141
-      mexec_open(8, c, n);
1142 1141
       return(mexec_quit(c, n));
1143 1142
     }
1144 1143
     if(!strcmp("exit", command_list[r])){
1145
-      mexec_open(8, c, n);
1146 1144
       return(mexec_quit(c, n));
1147 1145
     }
1148 1146
     if(!strcmp("bye", command_list[r])){
1149
-      mexec_open(8, c, n);
1150 1147
       return(mexec_quit(c, n));
1151 1148
     }
1152 1149
     if(!strcmp("send", command_list[r])){
... ...
@@ -1170,27 +1171,27 @@ int mexec(mcomm *c, int n)
1170 1170
       return(mexec_dsync(c, n));
1171 1171
     }
1172 1172
     if(!strcmp("members", command_list[r])){
1173
-      mexec_open(5, c, n);
1173
+      mexec_open(4, c, n);
1174 1174
       return(mexec_members(c, n));
1175 1175
     }
1176 1176
     if(!strcmp("echo", command_list[r])){
1177
-      mexec_open(5, c, n);
1177
+      mexec_open(4, c, n);
1178 1178
       return(mexec_echo(c, n));
1179 1179
     }
1180 1180
     if(!strcmp("loglevel", command_list[r])){
1181
-      mexec_open(5, c, n);
1181
+      mexec_open(4, c, n);
1182 1182
       return(mexec_loglevel(c, n));
1183 1183
     }
1184 1184
     if(!strcmp("exclude", command_list[r])){
1185
-      mexec_open(1, c, n);
1185
+      mexec_open(4, c, n);
1186 1186
       return(mexec_exclude(c, n));
1187 1187
     }
1188 1188
     if(!strcmp("status", command_list[r])){
1189
-      mexec_open(5, c, n);
1189
+      mexec_open(4, c, n);
1190 1190
       return(mexec_status(c, n));
1191 1191
     }
1192 1192
     if(!strcmp("alive", command_list[r])){
1193
-      mexec_open(8, c, n);
1193
+      mexec_open(4, c, n);
1194 1194
       return(mexec_alive(c, n));
1195 1195
     }
1196 1196
     c->working = 0;