Changeset - 72489034987c
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-04-18 23:10:27
ohnobinki@ohnopublishing.net
reindented distren.c
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/client/distren.c
Show inline comments
 
@@ -45,24 +45,26 @@ int main(int argc, char *argv[])
 
  
 
  cfg_opt_t cfg_opts[] =
 
    {
 
      CFG_STR_LIST("render_types", NULL, 0),
 
      CFG_STR("username", NULL, 0),
 
      CFG_STR("name", NULL, 0),
 
      CFG_STR("email", NULL, 0),
 
      CFG_END()
 
    };
 

	
 
  int i;
 
  
 
  i = 1;
 
  
 
  if(options_init(argc, argv, &cfg, cfg_opts, "client", &options))
 
    {
 
      fprintf(stderr, "error getting configuration\n");
 
      return 1;
 
    }
 

	
 

	
 
// Please find a better way of doing this :( you can't strcat multiple strings.. meh
 
// use something like sprintf
 
//char *username = cfg_getstr(cfg, "username");
 
//char *hostname = cfg_getstr(cfg, "hostname");
 
//strcat(username, "@");
 
@@ -90,24 +92,25 @@ if( i == 1 ){
 
  fprintf(stderr, "execio_open returns %d\n", execio_open(&testrem, "ssh", execargv));
 
  buf[9] = '\0';
 
  while(!execio_read(testrem, buf, 9, &readlen))
 
    {
 
      if(readlen > 9)
 
	{
 
	  fprintf(stderr, "execio_read doesn't set readlen correctly or read() is messed up\n");
 
	  return 1;
 
	}
 
      buf[readlen] = '\0';
 
      fprintf(stderr, "read \"%s\"\n", buf);
 
    }
 
    execio_close(testrem);
 
}
 

	
 
else
 
{
 
	printf("Well now, you must have registered!\n");
 
/* put code here to ssh to zserver2 w/ execio as the user from the conf file */
 
}
 

	
 

	
 
 options_free(options);
 
 return 0;
 
};
0 comments (0 inline, 0 general)