Skip to content

Commit

Permalink
Fix windows build due to getpwuid and getpwname functions
Browse files Browse the repository at this point in the history
  • Loading branch information
userwiths committed Aug 30, 2024
1 parent 35e0ffd commit 7c7c9d6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libfreshclam/libfreshclam.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ int fc_upsert_logg_file(fc_config *fcConfig)
}
int ret = 0, field_no = 1;
char *current_path, *file_path = cli_safer_strdup(fcConfig->logFile), *token;
FILE *logg_fp = NULL;
token = cli_strtok(file_path, field_no++, PATHSEP);
struct passwd *current_user = getpwuid(getuid()), *db_owner = getpwnam(fcConfig->dbOwner);
FILE *logg_fp = NULL;
token = cli_strtok(file_path, field_no++, PATHSEP);
struct passwd *current_user, *db_owner;
#ifndef _WIN32
current_user = getpwuid(getuid());
db_owner = getpwnam(fcConfig->dbOwner);
#endif /* _WIN32 */
current_path = (char *)malloc(2);
strcpy(current_path, PATHSEP);
STATBUF sb;
Expand Down

0 comments on commit 7c7c9d6

Please sign in to comment.