comparison cinst/nssstore_linux.c @ 478:214bf504c54f

Handle broken pipe as it is expected behavior
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 24 Apr 2014 10:39:09 +0000
parents e8d761c2d2d1
children e41a2537b84d
comparison
equal deleted inserted replaced
477:48161978c84c 478:214bf504c54f
187 /* Send the instructions */ 187 /* Send the instructions */
188 for (i = 0; to_install && to_install[i]; i++) 188 for (i = 0; to_install && to_install[i]; i++)
189 { 189 {
190 if (fprintf (stream, "I:%s\n", to_install[i]) <= 3) 190 if (fprintf (stream, "I:%s\n", to_install[i]) <= 3)
191 { 191 {
192 ERRORPRINTF ("Write failed: %s \n", strerror(errno)); 192 int err = errno;
193 ERRORPRINTF ("Write failed: %s \n", strerror(err));
194 if (err == 32)
195 {
196 /* Broken pipe is expected if there are no NSS stores
197 to be found the process just exits. That's ok */
198 success = true;
199 }
193 goto done; 200 goto done;
194 } 201 }
195 } 202 }
196 203
197 for (i = 0; to_remove && to_remove[i]; i++) 204 for (i = 0; to_remove && to_remove[i]; i++)
198 { 205 {
199 if (fprintf (stream, "R:%s\n", to_remove[i]) <= 3) 206 if (fprintf (stream, "R:%s\n", to_remove[i]) <= 3)
200 { 207 {
201 ERRORPRINTF ("Write failed: %s \n", strerror(errno)); 208 int err = errno;
209 ERRORPRINTF ("Write failed: %s \n", strerror(err));
210 if (err == 32)
211 {
212 /* Broken pipe is expected if there are no NSS stores
213 to be found the process just exits. That's ok */
214 success = true;
215 }
202 goto done; 216 goto done;
203 } 217 }
204 } 218 }
205 219
206 success = true; 220 success = true;

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