Diff for /embedtools/src/pceng.c between versions 1.1.2.9 and 1.2

version 1.1.2.9, 2011/07/25 09:16:36 version 1.2, 2012/07/22 22:46:47
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 49  SUCH DAMAGE. Line 49  SUCH DAMAGE.
   
 int Verbose, Kill;  int Verbose, Kill;
 extern char compiled[], compiledby[], compilehost[];  extern char compiled[], compiledby[], compilehost[];
sl_config cfg;cfg_root_t cfg;
 char szConf[MAXPATHLEN] = DEFAULT_PCENG_CFG;  char szConf[MAXPATHLEN] = DEFAULT_PCENG_CFG;
   
   
Line 73  sigHand(int sig) Line 73  sigHand(int sig)
   
         switch (sig) {          switch (sig) {
                 case SIGHUP:                  case SIGHUP:
                        UnloadConfig(&cfg);                        cfgUnloadConfig(&cfg);
                        if (LoadConfig(szConf, &cfg)) {                        if (cfgLoadConfig(szConf, &cfg)) {
                                 syslog(LOG_ERR, "Error:: #%d - %s", cfg_GetErrno(), cfg_GetError());                                  syslog(LOG_ERR, "Error:: #%d - %s", cfg_GetErrno(), cfg_GetError());
                                 raise(SIGTERM);                                  raise(SIGTERM);
                         }                          }
Line 96  main(int argc, char **argv) Line 96  main(int argc, char **argv)
         char ch, ledno, *pos;          char ch, ledno, *pos;
         int i, ret = 0, mode = 1;          int i, ret = 0, mode = 1;
         struct sigaction sact;          struct sigaction sact;
#ifdef HAVE_IO#ifdef __FreeBSD__
         int io;          int io;
 #endif  #endif
   
Line 124  main(int argc, char **argv) Line 124  main(int argc, char **argv)
         else          else
                 openlog("pceng", LOG_CONS | LOG_PID | LOG_PERROR, LOG_USER);                  openlog("pceng", LOG_CONS | LOG_PID | LOG_PERROR, LOG_USER);
   
#ifdef HAVE_IO#ifdef __FreeBSD__
         io = open(_PATH_DEVIO, O_RDONLY);          io = open(_PATH_DEVIO, O_RDONLY);
         if (io == -1) {          if (io == -1) {
                 printf("Error:: in open dev %s #%d - %s\n", _PATH_DEVIO, errno, strerror(errno));                  printf("Error:: in open dev %s #%d - %s\n", _PATH_DEVIO, errno, strerror(errno));
Line 133  main(int argc, char **argv) Line 133  main(int argc, char **argv)
         }          }
 #endif  #endif
   
        if (LoadConfig(szConf, &cfg)) {        if (cfgLoadConfig(szConf, &cfg)) {
                 printf("Error:: #%d - %s\n", cfg_GetErrno(), cfg_GetError());                  printf("Error:: #%d - %s\n", cfg_GetErrno(), cfg_GetError());
                 ret = 1;                  ret = 1;
                return 1;                goto end;
         }          }
   
         if (argc) {          if (argc) {
Line 151  main(int argc, char **argv) Line 151  main(int argc, char **argv)
                                 ch = -1;                                  ch = -1;
                         }                          }
                         ret = LED((u_char) ledno, (u_char) ch);                          ret = LED((u_char) ledno, (u_char) ch);
                        if (ch == -1 && ret != -1)                        printf("%s:: LED#%d=%d\n", (ch == -1) ? "Get" : "Set", ledno, ret);
                                printf("LED#%d=%d\n", ret); 
                 }                  }
                 goto end;                  goto end;
         }          }
Line 191  main(int argc, char **argv) Line 190  main(int argc, char **argv)
         ret = Run();          ret = Run();
   
 end:  end:
        UnloadConfig(&cfg);        cfgUnloadConfig(&cfg);
#ifdef HAVE_IO#ifdef __FreeBSD__
         if (io > 2)          if (io > 2)
                 close(io);                  close(io);
 #endif  #endif

Removed from v.1.1.2.9  
changed lines
  Added in v.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>