libexplain  1.4.D001
Functions
libexplain/pclose_success_or_die.c File Reference
#include <libexplain/ac/stdio.h>
#include <libexplain/buffer/errno/pclose.h>
#include <libexplain/buffer/wait_status.h>
#include <libexplain/common_message_buffer.h>
#include <libexplain/pclose.h>
#include <libexplain/string_buffer.h>
#include <libexplain/output.h>

Go to the source code of this file.

Functions

int explain_pclose_success (FILE *fp)
void explain_pclose_success_or_die (FILE *fp)

Function Documentation

int explain_pclose_success ( FILE *  fp)

The explain_pclose_success function is used to call the pclose(3) system call. On failure (including any exit status other than EXIT_SUCCESS) an explanation will be printed to stderr, obtained from explain_pclose(3). The return value from pclose(3) is returned.

This function is intended to be used in a fashion similar to the following example:

 int result = explain_pclose_success(fp);
Parameters:
fpThe fp, exactly as to be passed to the pclose(3) pclose call.
Returns:
the value returned by the pclose(3) pclose call.

Definition at line 31 of file pclose_success_or_die.c.

void explain_pclose_success_or_die ( FILE *  fp)

The explain_pclose_success_or_die function is used to call the pclose(3) system call. On failure (including any exit status other than EXIT_SUCCESS) an explanation will be printed to stderr, obtained from explain_pclose(3), and then the process terminates by calling exit(EXIT_FAILURE).

This function is intended to be used in a fashion similar to the following example:

Parameters:
fpThe fp, exactly as to be passed to the pclose(3) pclose call.
Returns:
This function only returns on success (exit status EXIT_SUCCESS (0) by the command). On failure (including non-zero exit status), prints an explanation and exits; it does not return.

Definition at line 62 of file pclose_success_or_die.c.