Changeset 5619:16fe78ec277c in roaraudio for libroar


Ignore:
Timestamp:
08/09/12 00:01:15 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Implemented watchdog (Closes: #291)

Location:
libroar
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • libroar/Makefile

    r5529 r5619  
    1111PASSWORD=passwordapi.o pinentry.o sshaskpass.o 
    1212CRYPTO=crypto.o random.o $(HASHES) crc.o 
    13 OBJS=libroar.o config.o debug.o error.o basic.o stream.o client.o simple.o auth.o socket.o ctl.o buffer.o meta.o file.o acl.o cdrom.o $(PASSWORD) $(VIO) stack.o slp.o nnode.o roardl.o plugincontainer.o roarx11.o beep.o proto.o env.o keyval.o vs.o ltm.o notify.o notify_proxy.o asyncctl.o enumdev.o serverinfo.o $(CRYPTO) authfile.o caps.o roarfloat.o base64.o trap.o memmgr.o time.o kstore.o uuid.o 
     13OBJS=libroar.o config.o debug.o error.o basic.o stream.o client.o simple.o auth.o socket.o ctl.o buffer.o meta.o file.o acl.o cdrom.o $(PASSWORD) $(VIO) stack.o slp.o nnode.o roardl.o plugincontainer.o roarx11.o beep.o proto.o env.o keyval.o vs.o ltm.o notify.o notify_proxy.o asyncctl.o enumdev.o serverinfo.o $(CRYPTO) authfile.o caps.o roarfloat.o base64.o trap.o memmgr.o time.o kstore.o uuid.o watchdog.o 
    1414 
    1515#DEFINES        = -DDEBUG 
  • libroar/basic.c

    r5608 r5619  
    9191  return -1; 
    9292 } else if ( r == 0 ) { // we are the child 
     93  roar_watchdog_stop(); 
     94 
    9395  close(socks[0]); 
    9496 
     
    113115  // we are still alive? 
    114116  ROAR_ERR("_start_server(*): alive after exec(), that's bad!"); 
    115   _exit(1); 
     117  ROAR_U_EXIT(1); 
    116118 } else { // we are the parent 
    117119  close(socks[1]); 
  • libroar/cdrom.c

    r5381 r5619  
    3636#include "libroar.h" 
    3737 
    38 #define ROAR_CDROM_ERROR_NORETURN(format, args...) ROAR_ERR(format, ## args); _exit(3) 
     38#define ROAR_CDROM_ERROR_NORETURN(format, args...) ROAR_ERR(format, ## args); ROAR_U_EXIT(3) 
    3939 
    4040#if BYTE_ORDER == BIG_ENDIAN 
  • libroar/libroar.c

    r5390 r5619  
    107107 struct timespec left; 
    108108 
    109  if ( t > (uint_least32_t)1000000 ) { 
     109 if ( t >= (uint_least32_t)1000000 ) { 
    110110  tv.tv_sec  = t/(uint_least32_t)1000000; 
    111111  t         -= tv.tv_sec*(uint_least32_t)1000000; 
     
    321321    errname = "Memory double freed"; 
    322322   break; 
     323  case ROAR_FATAL_ERROR_WATCHDOG: 
     324    errname = "Watchdog Timeout"; 
     325   break; 
    323326  default: 
    324327    errname = "<unknown error code, BAD>"; 
     
    332335#endif 
    333336 abort(); 
     337#ifdef ROAR_HAVE_U_EXIT 
     338 ROAR_U_EXIT(1); 
     339#endif 
    334340 
    335341 while(1); 
  • libroar/pinentry.c

    r5381 r5619  
    9999   break; 
    100100  case 0: 
     101    roar_watchdog_stop(); 
     102 
    101103    close(in[0]); 
    102104    close(out[1]); 
     
    105107 
    106108    if ( dup2(out[0], ROAR_STDIN) == -1 ) 
    107      _exit(1); 
     109     ROAR_U_EXIT(1); 
    108110 
    109111    if ( dup2(in[1], ROAR_STDOUT) == -1 ) 
    110      _exit(1); 
     112     ROAR_U_EXIT(1); 
    111113 
    112114    execlp(ROAR_HAVE_BIN_PINENTRY, "RoarAudio", "--display", display, "--ttytype", term, "--ttyname", tty, NULL); 
    113115 
    114     _exit(1); 
     116    ROAR_U_EXIT(1); 
    115117   break; 
    116118 } 
  • libroar/socket.c

    r5554 r5619  
    11761176  return -1; 
    11771177 } else if ( r == 0 ) { // we are the child 
     1178  roar_watchdog_stop(); 
     1179 
    11781180  close(socks[0]); 
    11791181 
     
    11891191  // we are still alive? 
    11901192  ROAR_ERR("roar_socket_open_ssh(*): alive after exec(), that's bad!"); 
    1191   _exit(1); 
     1193  ROAR_U_EXIT(1); 
    11921194 } else { // we are the parent 
    11931195  close(socks[1]); 
  • libroar/vio_cmd.c

    r5405 r5619  
    172172   break; 
    173173  case 0: 
     174    roar_watchdog_stop(); 
     175 
    174176    close(in[0]); 
    175177    close(out[1]); 
     
    178180 
    179181    if ( dup2(out[0], ROAR_STDIN) == -1 ) 
    180      _exit(1); 
     182     ROAR_U_EXIT(1); 
    181183 
    182184    if ( dup2(in[1], ROAR_STDOUT) == -1 ) 
    183      _exit(1); 
     185     ROAR_U_EXIT(1); 
    184186 
    185187    execlp("/bin/sh", "/bin/sh", "-c", child->cmd, (_LIBROAR_GOOD_CAST char*)NULL); 
    186188 
    187     _exit(1); 
     189    ROAR_U_EXIT(1); 
    188190   break; 
    189191 } 
Note: See TracChangeset for help on using the changeset viewer.