Date: Mon, 26 Dec 2016 12:39:25 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r310596 - user/bapt/diff Message-ID: <201612261239.uBQCdPZ3094274@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Mon Dec 26 12:39:25 2016 New Revision: 310596 URL: https://svnweb.freebsd.org/changeset/base/310596 Log: Do not pause in pr(1) to have the same behaviour as GNU diff Use execl instead of execv to avoid warnings Modified: user/bapt/diff/diffreg.c Modified: user/bapt/diff/diffreg.c ============================================================================== --- user/bapt/diff/diffreg.c Mon Dec 26 11:46:05 2016 (r310595) +++ user/bapt/diff/diffreg.c Mon Dec 26 12:39:25 2016 (r310596) @@ -381,10 +381,8 @@ diffreg(char *file1, char *file2, int fl /* redirect stdout to pr */ int pfd[2]; char *header; - char * prargv[] = { "pr", "-h", NULL, "-f", NULL }; xasprintf(&header, "%s %s %s", diffargs, file1, file2); - prargv[2] = header; signal(SIGPIPE, SIG_IGN); fflush(stdout); rewind(stdout); @@ -401,7 +399,7 @@ diffreg(char *file1, char *file2, int fl close(pfd[0]); } close(pfd[1]); - execv(_PATH_PR, (char *const *)prargv); + execl(_PATH_PR, _PATH_PR, "-h", header, (char *)0); _exit(127); default: /* parent */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612261239.uBQCdPZ3094274>