projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2780c2b
)
Sendcommand: fix usage of FileSendChunked()
author
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 2 Jan 2014 13:14:09 +0000
(14:14 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 2 Jan 2014 23:43:31 +0000
(
00:43
+0100)
citadel/utils/sendcommand.c
patch
|
blob
|
history
diff --git
a/citadel/utils/sendcommand.c
b/citadel/utils/sendcommand.c
index 6146dbb654f7a8ae845cc9012f96dce5f84a3238..5ee87fd41d7fc09801761e8772150211607502af 100644
(file)
--- a/
citadel/utils/sendcommand.c
+++ b/
citadel/utils/sendcommand.c
@@
-150,6
+150,8
@@
int main(int argc, char **argv)
char relhome[PATH_MAX]="";
char ctdldir[PATH_MAX]=CTDLDIR;
char relhome[PATH_MAX]="";
char ctdldir[PATH_MAX]=CTDLDIR;
+ StartLibCitadel(SIZ);
+
/* Parse command line */
while ((a = getopt(argc, argv, "h:w:")) != EOF) {
switch (a) {
/* Parse command line */
while ((a = getopt(argc, argv, "h:w:")) != EOF) {
switch (a) {
@@
-179,7
+181,7
@@
int main(int argc, char **argv)
);
fflush(stderr);
);
fflush(stderr);
-
//
alarm(watchdog);
+
alarm(watchdog);
serv_sock = uds_connectsock(file_citadel_admin_socket);
serv_gets(buf);
serv_sock = uds_connectsock(file_citadel_admin_socket);
serv_gets(buf);
@@
-210,8
+212,10
@@
int main(int argc, char **argv)
IOB.fd = serv_sock;
FDIOBufferInit(&FDIO, &IOB, fileno(stdin), -1);
IOB.fd = serv_sock;
FDIOBufferInit(&FDIO, &IOB, fileno(stdin), -1);
- while (FileSendChunked(&FDIO, &ErrStr));
+ while (FileSendChunked(&FDIO, &ErrStr)
>= 0
);
alarm(watchdog); /* reset the watchdog timer */
alarm(watchdog); /* reset the watchdog timer */
+ if (ErrStr != NULL)
+ fprintf(stderr, "Error while piping stuff: %s\n", ErrStr);
FDIOBufferDelete(&FDIO);
FreeStrBuf(&IOB.Buf);
serv_puts("000");
FDIOBufferDelete(&FDIO);
FreeStrBuf(&IOB.Buf);
serv_puts("000");
@@
-251,7
+255,7
@@
int main(int argc, char **argv)
}
StrBufAppendBuf(OutBuf, Line, 0);
StrBufAppendBufPlain(OutBuf, HKEY("\n"), 0);
}
StrBufAppendBuf(OutBuf, Line, 0);
StrBufAppendBufPlain(OutBuf, HKEY("\n"), 0);
-
//
alarm(watchdog); /* reset the watchdog timer */
+
alarm(watchdog); /* reset the watchdog timer */
break;
case eBufferNotEmpty:
break;
break;
case eBufferNotEmpty:
break;