| 246 | */ |
| 247 | |
| 248 | int /* O - 0 on success, -1 on error */ |
| 249 | cupsdOpenPipe(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 | /* |
no outgoing calls
no test coverage detected