[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DDL-ML] consist, ein kleiner SRCP Klientfür Mehrfachtraktion



Und der Patch sollte eigentlich auch noch an mein voriges Mail dran.
Harald.
diff -r -c consist-20020106/consist.c consist/consist.c
*** consist-20020106/consist.c	Sun Jan  6 10:07:35 2002
--- consist/consist.c	Sun Jan 20 16:34:10 2002
***************
*** 35,42 ****
    int locosInArg = 0;
  
    
!   while ((c=getopt(argc, argv, "+p:i:h")) != EOF) {
      switch(c) {
      case 'p': 
        { 
  	int port;
--- 35,49 ----
    int locosInArg = 0;
  
    
!   while ((c=getopt(argc, argv, "+p:i:s:h")) != EOF) {
      switch(c) {
+     case 's': 
+       { 
+ 	char *servername;
+ 	if (sscanf(optarg, "%s", servername) > 0)
+ 	  serverName = servername;
+       }
+       break;
      case 'p': 
        { 
  	int port;
***************
*** 53,59 ****
        break;
      case 'h':
      case '?':
!       fprintf(stderr,"Usage: %s [-p commandport] [-i infoport] \\\n", argv[0]);
        fprintf(stderr,"                   <masterloco> <slave1> <slave2> ...\n\n");
        fprintf(stderr,"loco spec is '<proto> <addr>'\n");
        fprintf(stderr,"Example: %s 'M1 16' 'M1 60'\n\n", argv[0]);
--- 60,66 ----
        break;
      case 'h':
      case '?':
!       fprintf(stderr,"Usage: %s [-s servername] [-p commandport] [-i infoport] \\\n", argv[0]);
        fprintf(stderr,"                   <masterloco> <slave1> <slave2> ...\n\n");
        fprintf(stderr,"loco spec is '<proto> <addr>'\n");
        fprintf(stderr,"Example: %s 'M1 16' 'M1 60'\n\n", argv[0]);
***************
*** 86,96 ****
    }
  
    if ((infoPort = portOpen(serverName, infoPortNum)) == -1) {
!     fprintf(stderr, "Info Port open failed\n");
      exit(255);
    }
    if ((commandPort = portOpen(serverName, commandPortNum)) == -1) {
!     fprintf(stderr, "Info Port open failed\n");
      exit(255);
    }
  
--- 93,103 ----
    }
  
    if ((infoPort = portOpen(serverName, infoPortNum)) == -1) {
!     fprintf(stderr, "Info port open to server %s port %d failed\n", serverName, infoPortNum);
      exit(255);
    }
    if ((commandPort = portOpen(serverName, commandPortNum)) == -1) {
!     fprintf(stderr, "Command port open to server %s port %d failed\n", serverName, commandPortNum);
      exit(255);
    }