comparison cinst/nssstore_linux.c @ 439:c88090a15ae4

Fix cinstprocesstest for new arguments. Handle errno on write errors
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 22 Apr 2014 13:27:23 +0000
parents 17e1c8f37d72
children e8d761c2d2d1
comparison
equal deleted inserted replaced
438:8f50533027af 439:c88090a15ae4
17 #include <sys/types.h> 17 #include <sys/types.h>
18 #include <sys/wait.h> 18 #include <sys/wait.h>
19 #include <string.h> 19 #include <string.h>
20 #include <stdlib.h> 20 #include <stdlib.h>
21 #include <limits.h> 21 #include <limits.h>
22 #include <errno.h>
22 23
23 #include "nssstore.h" 24 #include "nssstore.h"
24 #include "logging.h" 25 #include "logging.h"
25 #include "strhelp.h" 26 #include "strhelp.h"
26 27
185 /* Send the instructions */ 186 /* Send the instructions */
186 for (i = 0; to_install && to_install[i]; i++) 187 for (i = 0; to_install && to_install[i]; i++)
187 { 188 {
188 if (fprintf (stream, "I:%s\n", to_install[i]) <= 3) 189 if (fprintf (stream, "I:%s\n", to_install[i]) <= 3)
189 { 190 {
190 ERRORPRINTF ("Write failed \n"); 191 ERRORPRINTF ("Write failed: %s \n", strerror(errno));
191 goto done; 192 goto done;
192 } 193 }
193 } 194 }
194 195
195 for (i = 0; to_remove && to_remove[i]; i++) 196 for (i = 0; to_remove && to_remove[i]; i++)
196 { 197 {
197 if (fprintf (stream, "R:%s\n", to_remove[i]) <= 3) 198 if (fprintf (stream, "R:%s\n", to_remove[i]) <= 3)
198 { 199 {
199 ERRORPRINTF ("Write failed \n"); 200 ERRORPRINTF ("Write failed: %s \n", strerror(errno));
200 goto done; 201 goto done;
201 } 202 }
202 } 203 }
203 204
204 success = true; 205 success = true;

http://wald.intevation.org/projects/trustbridge/