Masanobu Yasui authored on 2009/05/25 12:48:47
Showing 2 changed files
... ...
@@ -80,7 +80,7 @@ int mfdirchk(mfile *d){
80 80
   if(d->mdata.head.flags & MAKUO_FLAG_ACK){
81 81
     return(1);
82 82
   }
83
-  for(m=mftop[0];m;m=m->next){
83
+  for(m=mftop[MFSEND];m;m=m->next){
84 84
     if(m == d){
85 85
       continue;
86 86
     }
... ...
@@ -276,7 +276,7 @@ int do_accept(mcomm *c, fd_set *fds)
276 276
   }
277 277
   c[i].addrlen = sizeof(c[i].addr);
278 278
   c[i].fd[0] = accept(s, (struct sockaddr *)(&c[i].addr), &(c[i].addrlen));
279
-  lprintf(1, "%s: accept from %s i=%d fd=%d\n", __func__, inet_ntoa(c[i].addr.sin_addr), i, c[i].fd[0]);
279
+  lprintf(1, "%s: socket[%d] from %s\n", __func__, i, inet_ntoa(c[i].addr.sin_addr));
280 280
   c[i].working = 1;
281 281
   return(0);
282 282
 }
... ...
@@ -313,9 +313,9 @@ void mloop()
313 313
       do_pong();
314 314
       do_recv();
315 315
       do_send();
316
-      do_exechk(moption.comm);
317 316
       do_accept(moption.comm, &rfds);
318 317
       do_comexe(moption.comm, &rfds);
318
+      do_exechk(moption.comm);
319 319
     }
320 320
   }
321 321
 }
... ...
@@ -5,21 +5,21 @@
5 5
 
6 6
 #include "makuosan.h"
7 7
 
8
-char *command_list[]={"quit",     /*  */
9
-                      "exit",     /*  */
10
-                      "bye",      /*  */
11
-                      "send",     /*  */
12
-                      "sync",     /*  */
13
-                      "dsync",    /*  */
14
-                      "members",  /*  */
15
-                      "status",   /*  */
16
-                      "md5",      /*  */
17
-                      "check",    /*  */
18
-                      "echo",     /*  */
19
-                      "exclude",  /*  */
20
-                      "loglevel", /*  */
21
-                      "help",     /*  */
22
-                      NULL};      /*  */
8
+char *command_list[]={"quit",
9
+                      "exit",
10
+                      "bye",
11
+                      "send",
12
+                      "sync",
13
+                      "dsync",
14
+                      "members",
15
+                      "status",
16
+                      "md5",
17
+                      "check",
18
+                      "echo",
19
+                      "exclude",
20
+                      "loglevel",
21
+                      "help",
22
+                      NULL};
23 23
 
24 24
 mfile *mexec_with_dsync(mcomm *c, char *fn, int dryrun, int recurs, mhost *t)
25 25
 {
... ...
@@ -254,11 +254,22 @@ int mexec_scan(mcomm *c, char *fn, mhost *h, int mode, gid_t gid)
254 254
 
255 255
 int mexec_close(mcomm *c, int n)
256 256
 {
257
+  int i;
257 258
   mfile *m;
258 259
 
259
-  lprintf(1 + n * 7, "%s: fd=%d n=%d\n", __func__, c->fd[n], n);
260
-  if(c->fd[n] != -1)
260
+  if(c->fd[n] != -1){
261 261
     close(c->fd[n]);
262
+    for(i=0;i<MAX_COMM;i++){
263
+      if(c == &(moption.comm[i])){
264
+        break;
265
+      }
266
+    }
267
+    if(n){
268
+      lprintf(8, "%s: socket[%d] (backend)\n", __func__, i);
269
+    }else{
270
+      lprintf(1, "%s: socket[%d]\n", __func__, i);
271
+    }
272
+  }
262 273
   c->fd[n]  = -1;
263 274
   c->size[n] = 0;
264 275
   if(!n){
... ...
@@ -274,7 +285,7 @@ int mexec_close(mcomm *c, int n)
274 274
     for(m=mftop[MFSEND];m;m=m->next){
275 275
       if(m->comm == c){
276 276
         m->comm = NULL;
277
-        lprintf(3, "%s: cancel %s\n", __func__, m->fn);
277
+        lprintf(3, "%s: cancel> %s\n", __func__, m->cmdline);
278 278
       }
279 279
     }
280 280
   }
... ...
@@ -831,7 +842,13 @@ int mexec_status(mcomm *c, int n)
831 831
   mfile  *m;
832 832
   struct tm *t;
833 833
 
834
+  /*----- pid -----*/
835
+  cprintf(0, c, "process: %d\n", getpid());
836
+
837
+  /*----- version -----*/
834 838
   cprintf(0,c,"version: %s\n", PACKAGE_VERSION);
839
+
840
+  /*----- basedir -----*/
835 841
   if(moption.chroot){
836 842
     cprintf(0, c, "chroot : %s/\n", moption.real_dir);
837 843
   }else{