Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 582824 | Differences between
and this patch

Collapse All | Expand All

(-)a/Makefile.PL (-1 / +1 lines)
Lines 17-23 my %WriteMakefileArgs = ( Link Here
17
    ABSTRACT_FROM    => 'lib/Proc/ProcessTable.pm',
17
    ABSTRACT_FROM    => 'lib/Proc/ProcessTable.pm',
18
    LICENSE          => 'artistic_2',
18
    LICENSE          => 'artistic_2',
19
    'LDFROM'    => '$(O_FILES)',
19
    'LDFROM'    => '$(O_FILES)',
20
    'LIBS'     => [''],
20
    'LIBS'     => ['-lobstack'],
21
    'OBJECT'    => 'ProcessTable.o OS.o',
21
    'OBJECT'    => 'ProcessTable.o OS.o',
22
    MIN_PERL_VERSION => '5.006',
22
    MIN_PERL_VERSION => '5.006',
23
    CONFIGURE_REQUIRES => {
23
    CONFIGURE_REQUIRES => {
(-)a/os/Linux.c (-2 / +7 lines)
Lines 328-334 static bool get_proc_stat(char *pid, char *format_str, struct procstat* prs, Link Here
328
    /* scan in pid, and the command, in linux the command is a max of 15 chars
328
    /* scan in pid, and the command, in linux the command is a max of 15 chars
329
     * plus a terminating NULL byte; prs->comm will be NULL terminated since
329
     * plus a terminating NULL byte; prs->comm will be NULL terminated since
330
     * that area of memory is all zerored out when prs is allocated */
330
     * that area of memory is all zerored out when prs is allocated */
331
    if (sscanf(stat_text, "%d (%15c", &prs->pid, prs->comm) != 2)
331
    /* Apparently %15c means 'exactly 15' but a glibc bug allows matching
332
     * regardles. musl won't match it.
333
     * See: https://www.openwall.com/lists/musl/2013/11/15/5
334
     * and: https://sourceware.org/bugzilla/show_bug.cgi?id=12701 */
335
    if (sscanf(stat_text, "%d (%c", &prs->pid, prs->comm) != 2)
332
      /* we might get an empty command name, so check for it:
336
      /* we might get an empty command name, so check for it:
333
       * do the open and close parenteses lie next to each other?
337
       * do the open and close parenteses lie next to each other?
334
       * proceed if yes, finish otherwise
338
       * proceed if yes, finish otherwise
Lines 393-399 static void eval_link(char *pid, char *link_rel, enum field field, char **ptr, Link Here
393
     * for the cwd symlink, since on linux the links we care about will never
397
     * for the cwd symlink, since on linux the links we care about will never
394
     * be relative links (cwd, exec)
398
     * be relative links (cwd, exec)
395
     * Doing this because readlink works on static buffers */
399
     * Doing this because readlink works on static buffers */
396
    link = canonicalize_file_name(link_file);
400
    /* canonicalize_file_name is no good for musl, use realpath instead */
401
    link = realpath(link_file, NULL);
397
    /* we no longer need need the path to the link file */
402
    /* we no longer need need the path to the link file */
398
    obstack_free(mem_pool, link_file);
403
    obstack_free(mem_pool, link_file);
(-)a/t/process.t (-1 / +2 lines)
Lines 84-88 else Link Here
84
{
84
{
85
  # child, fork returned 0
85
  # child, fork returned 0
86
  # child process will be killed soon
86
  # child process will be killed soon
87
  sleep 10000;
87
  # 10,000 seconds is a long time to wait
88
  sleep 10;
88
}
89
}

Return to bug 582824