Skip to content

Do not merge: Prove that ENT-12953 is caused by ENT-12751 #5802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions libpromises/processes_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,17 +778,6 @@ static bool SplitProcLine(const char *line,

Take these two examples:

Windows:
User field can contain spaces. E.g.:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
NETWORK SERVICE 540 0.0 0.3 5092 11180 ? ? Apr28 00:00 C:\\Windows\\system32\\svchost.exe -k RPCSS -p
etc.

There is really no good way to do this with the current parsing logic. We
know that the next field will be a PID, so we can parse until we find a
number.

AIX:
USER PID PPID PGID %CPU %MEM VSZ NI S STIME TIME COMMAND
root 1 0 0 0.0 0.0 784 20 A Nov 28 00:00:00 /etc/init
Expand Down Expand Up @@ -902,7 +891,6 @@ Solaris 9:
bool cmd = (strcmp(names[field], "CMD") == 0 ||
strcmp(names[field], "COMMAND") == 0);
bool stime = !cmd && (strcmp(names[field], "STIME") == 0);
bool is_user_field = StringEqual(names[field], "USER");

// Equal boolean results, either both must be true, or both must be
// false. IOW we must either both be at the last field, and it must be
Expand Down Expand Up @@ -993,41 +981,6 @@ Solaris 9:
last++;
}
}
else if (is_user_field)
{
bool done = false;
while (!done)
{
while (line[last] != '\0' && !isspace(line[last]))
{
last++;
}

/* On windows the USER field can contain spaces. We know that
* the next field will be PID. Hence, we seek past the spaces
* to see if the next thing is a number. If this is not the
* case, we assume it is still the USER field. This is not
* bulletproof. However, this parser never was. */
int seek_past = last;
while (line[seek_past] != '\0' && isspace(line[seek_past]))
{
seek_past++;
}

if (line[seek_past] == '\0')
{
done = true;
}
else if (isdigit(line[seek_past]))
{
done = true;
}
else
{
last = seek_past;
}
}
}
else
{
// Generic fields
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ libdb_la_LIBADD = ../../libntech/libutils/libutils.la
libdb_la_CFLAGS = $(AM_CFLAGS)

check_PROGRAMS = \
processes_select_test \
arg_split_test \
assoc_test \
getopt_test \
Expand Down Expand Up @@ -188,10 +187,6 @@ if HPUX
XFAIL_TESTS = mon_load_test # Redmine #3569
endif


processes_select_test_SOURCES = processes_select_test.c
processes_select_test_LDADD = libtest.la ../../libpromises/libpromises.la

#
# OS X uses real system calls instead of our stubs unless this option is used
#
Expand Down
45 changes: 0 additions & 45 deletions tests/unit/processes_select_test.c

This file was deleted.

Loading