Skip to content

Commit

Permalink
adb: Fix backup fallback
Browse files Browse the repository at this point in the history
 * Check for existence of binary first

Change-Id: I5c1884655ae031f51cb935221ae7870b016e259d
  • Loading branch information
hyperb1iss committed Nov 12, 2013
1 parent de1237a commit b32cdd0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions adb/backup_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ int backup_service(BackupOperation op, char* args) {
adb_close(s[0]);

// off we go
execvp("/system/bin/bu", (char * const *)bu_args);
execvp("/sbin/bu", (char * const *)bu_args);
if (access("/system/bin/bu", F_OK) == 0)
execvp("/system/bin/bu", (char * const *)bu_args);
else if (access("/sbin/bu", F_OK) == 0)
execvp("/sbin/bu", (char * const *)bu_args);

// oops error - close up shop and go home
fprintf(stderr, "Unable to exec 'bu', bailing\n");
exit(-1);
Expand Down

0 comments on commit b32cdd0

Please sign in to comment.