Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=e33223084bd63f68d53cce4b8c9fb57bcd495e98

commit e33223084bd63f68d53cce4b8c9fb57bcd495e98
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Sun May 15 16:08:36 2011 +0200

silence warning on -Su when lsof is not installed

diff --git a/src/pacman-g2/ps.c b/src/pacman-g2/ps.c
index cd31e07..b7fb45c 100644
--- a/src/pacman-g2/ps.c
+++ b/src/pacman-g2/ps.c
@@ -36,7 +36,7 @@

extern config_t *config;

-static int start_lsof(FILE** childout, pid_t* childpid)
+static int start_lsof(FILE** childout, pid_t* childpid, int silent)
{
char *args[] = { "lsof", "-n", "-FLpcnf0", NULL };
int pout[2];
@@ -58,7 +58,8 @@ static int start_lsof(FILE** childout, pid_t* childpid)
close(pout[0]);
execvp(args[0], args);
/* on sucess, execv never returns */
-               ERR(NL, _("failed to execute \"lsof\".\n"));
+               if (!silent)
+                       ERR(NL, _("failed to execute \"lsof\".\n"));
exit(1);
}
close(pout[1]);
@@ -202,7 +203,7 @@ int pspkg(int countonly)
return -1;
}

-       if (start_lsof(&fpout, &pid) < 0)
+       if (start_lsof(&fpout, &pid, countonly) < 0)
return -1;

list_t* ret = ps_parse(fpout);
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to