update godoc and code style

This commit is contained in:
vcaesar 2018-11-14 12:07:26 -04:00
parent f0984bdabc
commit adf02582ab
2 changed files with 5 additions and 6 deletions

View File

@ -1551,7 +1551,8 @@ func FindNames() ([]string, error) {
return strArr, err return strArr, err
} }
// FindIds finds the all processes named with a subset of "name" (case insensitive), // FindIds finds the all processes named with a subset
// of "name" (case insensitive),
// return matched IDs. // return matched IDs.
func FindIds(name string) ([]int32, error) { func FindIds(name string) ([]int32, error) {
var pids []int32 var pids []int32

View File

@ -121,8 +121,7 @@ int showAlert(const char *title, const char *msg, const char *defaultButton,
*/ */
static int runTask(const char *taskname, char * const argv[], int *exit_status); static int runTask(const char *taskname, char * const argv[], int *exit_status);
static int xmessage(char *argv[], int *exit_status) static int xmessage(char *argv[], int *exit_status) {
{
// static const char * const MSG_PROGS[] = {"gmessage", "gxmessage", // static const char * const MSG_PROGS[] = {"gmessage", "gxmessage",
// "kmessage", "xmessage"}; // "kmessage", "xmessage"};
static const char * const MSG_PROGS[] = {"xmessage"}; static const char * const MSG_PROGS[] = {"xmessage"};
@ -154,8 +153,7 @@ static int xmessage(char *argv[], int *exit_status)
return ret; return ret;
} }
static int runTask(const char *taskname, char * const argv[], int *exit_status) static int runTask(const char *taskname, char * const argv[], int *exit_status) {
{
pid_t pid = fork(); pid_t pid = fork();
int status; int status;
@ -164,7 +162,7 @@ static int runTask(const char *taskname, char * const argv[], int *exit_status)
perror("fork"); perror("fork");
return FORK_FAILED; /* Failed to fork. */ return FORK_FAILED; /* Failed to fork. */
case 0: /* Child process */ case 0: /* Child process */
if (strcmp(argv[0],"xmessage") == 0){ if (strcmp(argv[0], "xmessage") == 0){
execvp(taskname, argv); execvp(taskname, argv);
perror("execvp failed"); perror("execvp failed");
} }