--- embedtools/src/imgupd.c 2014/02/06 14:22:43 1.6.2.6 +++ embedtools/src/imgupd.c 2014/02/06 15:32:11 1.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: imgupd.c,v 1.6.2.6 2014/02/06 14:22:43 misho Exp $ + * $Id: imgupd.c,v 1.7 2014/02/06 15:32:11 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -61,7 +61,6 @@ Usage() " Syntax: imgupd [options] [image_file]\n\n" "\t-v\t\tVerbose ...\n" "\t-R\t\tReboot system after complete\n" - "\t-p\t\tPipe suitable transfer on little chunks\n" "\t-i\t\tStart fill storage from begin\n" "\t-g\t\tGet image from Storage\n" "\t-t\t\tTruncate Storage file name\n" @@ -184,7 +183,7 @@ main(int argc, char **argv) char ch, m = 0, R = 0; int fd, img, tr = 0; - while ((ch = getopt(argc, argv, "hvRipgts:f:")) != -1) + while ((ch = getopt(argc, argv, "hvRigts:f:")) != -1) switch (ch) { case 'f': strlcpy(imgName, optarg, sizeof imgName); @@ -199,9 +198,6 @@ main(int argc, char **argv) case 't': tr = O_TRUNC; break; - case 'p': - bufSize = IMGBUF_SIZE2; - break; case 'g': m = 1; case 'i': @@ -335,12 +331,13 @@ main(int argc, char **argv) } } else { /* GET */ iSize ^= iSize; - if (EmptyStore(fd, fileFlg) == -1) { - if (fd > 2) - close(fd); - close(img); - return 3; - } + if (!(fileFlg & FD_PIPE)) + if (EmptyStore(fd, fileFlg) == -1) { + if (fd > 2) + close(fd); + close(img); + return 3; + } if (FillStore(fd, fileFlg, img, nameFlg) == -1) { if (fd > 2) close(fd);