Skip to content

Commit

Permalink
Add more error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ortmann committed Nov 28, 2023
1 parent 3af9203 commit 9cbeae3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mod/share.mod/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "src/mod/module.h"

#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -1244,9 +1245,11 @@ static void share_ufsend(int idx, char *par)
zapfbot(idx);
} else if (copy_to_tmp && !(f = tmpfile())) {
putlog(LOG_MISC, "*", "CAN'T WRITE TEMPORARY USERFILE DOWNLOAD FILE!");
debug1("share: tmpfile(): %s", strerror(errno));
zapfbot(idx);
} else if (!copy_to_tmp && !(f = fopen(s, "wb"))) {
putlog(LOG_MISC, "*", "CAN'T WRITE USERFILE DOWNLOAD FILE!");
debug2("share: fopen(%s): %s", s, strerror(errno));
zapfbot(idx);
} else {
/* Ignore longip and use botaddr, arg kept for backward compat for pre 1.8.3 */
Expand Down

0 comments on commit 9cbeae3

Please sign in to comment.