MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsdOpenPipe

Function cupsdOpenPipe

scheduler/file.c:248–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246 */
247
248int /* O - 0 on success, -1 on error */
249cupsdOpenPipe(int *fds) /* O - Pipe file descriptors (2) */
250{
251 /*
252 * Create the pipe...
253 */
254
255 if (pipe(fds))
256 {
257 fds[0] = -1;
258 fds[1] = -1;
259
260 return (-1);
261 }
262
263 /*
264 * Set the "close on exec" flag on each end of the pipe...
265 */
266
267 if (fcntl(fds[0], F_SETFD, fcntl(fds[0], F_GETFD) | FD_CLOEXEC))
268 {
269 close(fds[0]);
270 close(fds[1]);
271
272 fds[0] = -1;
273 fds[1] = -1;
274
275 return (-1);
276 }
277
278 if (fcntl(fds[1], F_SETFD, fcntl(fds[1], F_GETFD) | FD_CLOEXEC))
279 {
280 close(fds[0]);
281 close(fds[1]);
282
283 fds[0] = -1;
284 fds[1] = -1;
285
286 return (-1);
287 }
288
289 /*
290 * Return 0 indicating success...
291 */
292
293 return (0);
294}
295
296
297/*

Callers 7

cupsd_start_notifierFunction · 0.85
pipe_commandFunction · 0.85
cupsdStartSystemMonitorFunction · 0.85
cupsdStartServerFunction · 0.85
copy_modelFunction · 0.85
cupsdContinueJobFunction · 0.85
start_jobFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected