Skip to content

Commit

Permalink
Remove explicit error output
Browse files Browse the repository at this point in the history
  • Loading branch information
mfragkoulis committed Jan 17, 2017
1 parent eb20db8 commit ad69404
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
8 changes: 2 additions & 6 deletions src/comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ compare_files (int nfiles, char **infiles)
int ninputfds = 2 - nfiles;
int *inputfds;
int *outputfds;
int status = -1;

/* dgsh
if (STREQ(infiles[0], "-"))
Expand All @@ -292,12 +291,9 @@ compare_files (int nfiles, char **infiles)
ninputfds++;
*/

if ((status = dgsh_negotiate(negotiation_title, &ninputfds, &noutputfds,
&inputfds, &outputfds)))
{
DPRINTF("dgsh negotiation failed with status code %d.\n", status);
if (dgsh_negotiate(negotiation_title, &ninputfds, &noutputfds,
&inputfds, &outputfds) != 0)
exit(1);
}

/* The first file descriptor has been set to stdin */
if (ninputfds > 0)
Expand Down
8 changes: 2 additions & 6 deletions src/join.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,13 +1219,9 @@ main (int argc, char **argv)
else
snprintf(negotiation_title, 100, "%s", argv[0]);

int exit_status;
if ((exit_status = dgsh_negotiate(negotiation_title,
&ninputfds, NULL, &inputfds, NULL)) != 0)
{
DPRINTF("dgsh negotiation failed with status code %d.\n", exit_status);
if (dgsh_negotiate(negotiation_title,
&ninputfds, NULL, &inputfds, NULL) != 0)
exit(1);
}

fp1 = STREQ (g_names[0], "-") ? stdin : fopen (g_names[0], "r");
if (!fp1)
Expand Down
8 changes: 2 additions & 6 deletions src/paste.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,13 @@ paste_serial (size_t nfiles, char **fnamptr)
FILE *fileptr; /* Open for reading current file. */

/* dgsh */
int status = -1;
int j = 0;
int ninputfds = -1;
int *inputfds;

if ((status = dgsh_negotiate("paste", &ninputfds, NULL,
&inputfds, NULL)) != 0)
{
DPRINTF("dgsh negotiation failed with status code %d.\n", status);
if (dgsh_negotiate("paste", &ninputfds, NULL,
&inputfds, NULL) != 0)
exit(1);
}

for (; nfiles; nfiles--, fnamptr++)
{
Expand Down
8 changes: 2 additions & 6 deletions src/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -3894,20 +3894,16 @@ sort (char ***files, size_t nfiles, char const *output_file,
int j = 0;
int ninputfds = 0;
int *inputfds;
int status = -1;
int count_stdin_files = 0;

buf.alloc = 0;

if (nfiles == 1 && STREQ((*files)[0], "-"))
ninputfds = -1;

if ((status = dgsh_negotiate(negotiation_title,
&ninputfds, NULL, &inputfds, NULL)) != 0)
{
DPRINTF("dgsh negotiation failed with status code %d.\n", status);
if (dgsh_negotiate(negotiation_title,
&ninputfds, NULL, &inputfds, NULL) != 0)
exit(1);
}

/* Count stdin input file directives */
for (j = 0; j < nfiles; j++)
Expand Down

0 comments on commit ad69404

Please sign in to comment.