Changeset - 262e6275036b
[Not reviewed]
default
0 3 0
Nathan Brink (binki) - 16 years ago 2009-12-12 17:45:38
ohnobinki@ohnopublishing.net
fix sendSignal() use of remoteio, config
3 files changed with 13 insertions and 5 deletions:
0 comments (0 inline, 0 general)
etc/distrenslave.conf.in
Show inline comments
 
@@ -2,7 +2,7 @@ slave
 
{
 
  username = "!username"
 
  datadir = "@LOCALSTATEDIR@/@PACKAGE@"
 
  hostname = "protofusion.org"
 
  server = "protofusion"
 
}
 

	
 
include("distrencommon.conf")
src/common/remoteio.h
Show inline comments
 
@@ -38,7 +38,9 @@ int remoteio_open(struct remoteio **rem,
 

	
 
/**
 
   non-blocking I/O.
 
   @return 0 on success, 1 on failure
 
   @param len must be greater than 0
 

	
 
   @return 0 on success, 1 on failure. 
 
 */
 
int remoteio_read(struct remoteio *rem, void *buf, size_t len, size_t *bytesread);
 
int remoteio_write(struct remoteio *rem, void *buf, size_t len, size_t *byteswritten);
src/server/slavefuncs.c
Show inline comments
 
@@ -47,14 +47,20 @@ int sendSignal(struct remoteio *rem, int
 

	
 
  _distren_asprintf(&ssignal, "%d", signal);
 
  towrite = strlen(ssignal);
 
  while( !remoteio_write(rem, ssignal, towrite, &written)
 
	 && towrite
 
	 && written)
 
  while( towrite
 
	 && !remoteio_write(rem, ssignal, towrite, &written))
 
    {
 
      printf(stderr, "Writing...");
 
      towrite -= written;
 
    }
 
  if(written)
 
  return 0;
 

	
 
  /**
 
     if remoteio_write returned 1, the connection
 
     is probably dead or there was a real error
 
   */
 
  return 1;
 
}
 
/**
 
 utility function for XPath-ish stuff:
0 comments (0 inline, 0 general)