1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-22 10:31:56 +02:00

tools: env: shift optind arguments and fix argument indices

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
This commit is contained in:
Andreas Fenkart
2015-12-09 13:13:25 +01:00
committed by Tom Rini
parent 371ee13760
commit 1ce686978c
2 changed files with 15 additions and 43 deletions

View File

@@ -182,6 +182,10 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
/* shift parsed flags, jump to non-option arguments */
argc -= optind;
argv += optind;
lockfd = open(lockname, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (-1 == lockfd) {
fprintf(stderr, "Error opening lock file %s\n", lockname);