Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions backend/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,12 +1400,18 @@ main(int argc, /* I - Number of command-line args */
if ((compatsize = write(fd, buffer, (size_t)bytes)) < 0)
{
perror("DEBUG: Unable to write temporary file");
if (tmpfilename[0])
unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}

if ((bytes = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
backendNetworkSideCB)) < 0)
{
if (tmpfilename[0])
unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}

compatsize += bytes;

Expand Down
10 changes: 8 additions & 2 deletions backend/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */

sleep(5);

if (snmp_fd >= 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this.

_cupsSNMPClose(snmp_fd);
if (print_fd != 0)
close(print_fd);
return (CUPS_BACKEND_FAILED);
}

Expand All @@ -324,6 +328,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
{
_cupsLangPrintFilter(stderr, "ERROR",
_("The printer is not responding."));
if (snmp_fd >= 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

httpAddrClose, which is what the other close calls, unlinks too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for Unix domain sockets. SNMP uses UDP sockets which have no corresponding local file.

_cupsSNMPClose(snmp_fd);
if (print_fd != 0)
close(print_fd);
return (CUPS_BACKEND_FAILED);
}

Expand Down Expand Up @@ -429,8 +437,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */

close(device_fd);

httpAddrFreeList(addrlist);

/*
* Close the input file and return...
*/
Expand Down
Loading