Changeset 5895:2bcffab4cd73 in roaraudio for libroar/vio_cmd.c
- Timestamp:
- 04/14/13 13:38:03 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/vio_cmd.c
r5832 r5895 141 141 int roar_vio_cmd_fork(struct roar_vio_cmd_child * child) { 142 142 int in[2], out[2]; 143 char * bin_sh; 143 144 144 145 if ( child == NULL ) … … 185 186 ROAR_U_EXIT(1); 186 187 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); 188 195 189 196 ROAR_U_EXIT(1); … … 621 628 char command[1024]; 622 629 char para[1024] = {0}; 630 char * bin_gpg; 623 631 int pwpipe[2]; 624 632 int ret; 633 int err; 625 634 626 635 /* … … 640 649 strncat(para, "--textmode ", 16); 641 650 651 bin_gpg = roar_libroar_get_path("bin-gpg", 0, NULL, NULL); 652 if ( bin_gpg == NULL ) 653 return -1; 654 642 655 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; 644 660 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); 647 664 648 665 write(pwpipe[1], pw, strlen(pw)); … … 650 667 close(pwpipe[1]); 651 668 } 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); 654 673 655 674 if ( wronly ) {
Note: See TracChangeset
for help on using the changeset viewer.