diff options
-rw-r--r-- | procfs_pid_files.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/procfs_pid_files.c b/procfs_pid_files.c index d44a2a22..26a0af33 100644 --- a/procfs_pid_files.c +++ b/procfs_pid_files.c @@ -49,7 +49,16 @@ update_pid_entries (struct procfs_dir *dir, const char *name, struct stat stat; memset (&stat, 0, sizeof stat); - stat->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH; + if (symlink_target) + { + stat.st_size = strlen (symlink_target); + stat.st_mode = S_IFLNK | 0777; + } + else + { + stat.st_size = 0; + stat.st_mode = S_IFREG | 0444; + } return update_entries_list (dir, name, &stat, timestamp, symlink_target); } |