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

Function cupsTempFile2

cups/tempfile.c:191–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189 */
190
191cups_file_t * /* O - CUPS file or @code NULL@ on error */
192cupsTempFile2(char *filename, /* I - Pointer to buffer */
193 int len) /* I - Size of buffer */
194{
195 cups_file_t *file; /* CUPS file */
196 int fd; /* File descriptor */
197
198
199 if ((fd = cupsTempFd(filename, len)) < 0)
200 return (NULL);
201 else if ((file = cupsFileOpenFd(fd, "w")) == NULL)
202 {
203 close(fd);
204 unlink(filename);
205 return (NULL);
206 }
207 else
208 return (file);
209}

Callers 8

cupsdCreateProfileFunction · 0.85
do_set_optionsFunction · 0.85
set_pstops_optionsFunction · 0.85
set_printer_optionsFunction · 0.85
_ppdCreateFromIPP2Function · 0.85

Calls 2

cupsTempFdFunction · 0.85
cupsFileOpenFdFunction · 0.85

Tested by

no test coverage detected