-
Notifications
You must be signed in to change notification settings - Fork 263
Free, close, and unlink files when failure happens #1407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -313,6 +313,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ | |
|
|
||
| sleep(5); | ||
|
|
||
| if (snmp_fd >= 0) | ||
| _cupsSNMPClose(snmp_fd); | ||
| if (print_fd != 0) | ||
| close(print_fd); | ||
| return (CUPS_BACKEND_FAILED); | ||
| } | ||
|
|
||
|
|
@@ -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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need this either.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. httpAddrClose, which is what the other close calls, unlinks too.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
| } | ||
|
|
||
|
|
@@ -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... | ||
| */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this.