Skip to content

Commit

Permalink
Log the right slave program name
Browse files Browse the repository at this point in the history
  • Loading branch information
heftig authored and davidebeatrici committed Aug 31, 2024
1 parent f5bbe54 commit a544802
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ossp-alsap.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ int main(int argc, char **argv)
{
int rc;

ossp_slave_init(argc, argv);
ossp_slave_init("ossp-alsap", argc, argv);

page_size = sysconf(_SC_PAGE_SIZE);

Expand Down
2 changes: 1 addition & 1 deletion ossp-padsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ int main(int argc, char **argv)
{
int rc;

ossp_slave_init(argc, argv);
ossp_slave_init("ossp-padsp", argc, argv);

page_size = sysconf(_SC_PAGE_SIZE);

Expand Down
6 changes: 3 additions & 3 deletions ossp-slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int ossp_cmd_fd = -1, ossp_notify_fd = -1;
void *ossp_mmap_addr[2];
struct ossp_transfer *ossp_mmap_transfer;

void ossp_slave_init(int argc, char **argv)
void ossp_slave_init(const char *slave_name, int argc, char **argv)
{
int have_uid = 0, have_gid = 0;
uid_t uid;
Expand Down Expand Up @@ -91,8 +91,8 @@ void ossp_slave_init(int argc, char **argv)
snprintf(ossp_user_name, sizeof(ossp_user_name), "%s",
pw->pw_name);

snprintf(ossp_log_name, sizeof(ossp_log_name), "ossp-padsp[%s:%d]",
ossp_user_name, getpid());
snprintf(ossp_log_name, sizeof(ossp_log_name), "%s[%s:%d]",
slave_name, ossp_user_name, getpid());

if (mmap_fd >= 0) {
void *p;
Expand Down
2 changes: 1 addition & 1 deletion ossp-slave.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern int ossp_cmd_fd, ossp_notify_fd;
extern void *ossp_mmap_addr[2];
extern struct ossp_transfer *ossp_mmap_transfer;

void ossp_slave_init(int argc, char **argv);
void ossp_slave_init(const char *slave_name, int argc, char **argv);
int ossp_slave_process_command(int cmd_fd,
ossp_action_fn_t const *action_fn_tbl,
int (*action_pre_fn)(void),
Expand Down

0 comments on commit a544802

Please sign in to comment.