Changeset 5895:2bcffab4cd73 in roaraudio for libroar/vio_cmd.c


Ignore:
Timestamp:
04/14/13 13:38:03 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Moved away from roar_libroar_get_path_static()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_cmd.c

    r5832 r5895  
    141141int roar_vio_cmd_fork(struct roar_vio_cmd_child * child) { 
    142142 int in[2], out[2]; 
     143 char * bin_sh; 
    143144 
    144145 if ( child == NULL ) 
     
    185186     ROAR_U_EXIT(1); 
    186187 
    187     execlp(roar_libroar_get_path_static("bin-sh"), roar_libroar_get_path_static("bin-sh"), "-c", child->cmd, (_LIBROAR_GOOD_CAST char*)NULL); 
     188    bin_sh = roar_libroar_get_path("bin-sh", 0, NULL, NULL); 
     189    if ( bin_sh == NULL ) 
     190     ROAR_U_EXIT(1); 
     191 
     192    execlp(bin_sh, bin_sh, "-c", child->cmd, (_LIBROAR_GOOD_CAST char*)NULL); 
     193 
     194    roar_mm_free(bin_sh); 
    188195 
    189196    ROAR_U_EXIT(1); 
     
    621628 char command[1024]; 
    622629 char para[1024] = {0}; 
     630 char * bin_gpg; 
    623631 int pwpipe[2]; 
    624632 int ret; 
     633 int err; 
    625634 
    626635/* 
     
    640649  strncat(para, "--textmode ", 16); 
    641650 
     651 bin_gpg = roar_libroar_get_path("bin-gpg", 0, NULL, NULL); 
     652 if ( bin_gpg == NULL ) 
     653  return -1; 
     654 
    642655 if ( pw != NULL ) { 
    643   if ( pipe(pwpipe) == -1 ) 
     656  if ( pipe(pwpipe) == -1 ) { 
     657   err = roar_error; 
     658   roar_mm_free(bin_gpg); 
     659   roar_error = err; 
    644660   return -1; 
    645  
    646   snprintf(command, 1024, "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", roar_libroar_get_path_static("bin-gpg"), pwpipe[0], para, opts); 
     661  } 
     662 
     663  snprintf(command, 1024, "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", bin_gpg, pwpipe[0], para, opts); 
    647664 
    648665  write(pwpipe[1], pw, strlen(pw)); 
     
    650667  close(pwpipe[1]); 
    651668 } else { 
    652   snprintf(command, 1024, "%s --no-verbose --quiet %s %s", roar_libroar_get_path_static("bin-gpg"), para, opts); 
    653  } 
     669  snprintf(command, 1024, "%s --no-verbose --quiet %s %s", bin_gpg, para, opts); 
     670 } 
     671 
     672 roar_mm_free(bin_gpg); 
    654673 
    655674 if ( wronly ) { 
Note: See TracChangeset for help on using the changeset viewer.