PostgreSQL Source Code  git master
err.c File Reference
#include "c.h"
#include <err.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for err.c:

Go to the source code of this file.

Functions

void err (int eval, const char *fmt,...)
 
void errx (int eval, const char *fmt,...)
 

Function Documentation

◆ err()

void err ( int  eval,
const char *  fmt,
  ... 
)

Definition at line 43 of file err.c.

44 {
45  int code = errno;
46  va_list ap;
47  va_start(ap, fmt);
48  if (fmt != NULL) {
49  vfprintf(stderr, fmt, ap);
50  fprintf(stderr, ": ");
51  }
52  fprintf(stderr, "%s\n", strerror(code));
53  va_end(ap);
54  exit(eval);
55 }
static void const char * fmt
va_end(args)
vfprintf(stderr, fmt, args)
exit(1)
va_start(args, fmt)
#define strerror
Definition: port.h:251
#define fprintf
Definition: port.h:242

References exit(), fmt, fprintf, strerror, va_end(), va_start(), and vfprintf().

Referenced by add_typename(), alloc_typenames(), AlterSubscription(), AlterSubscription_refresh(), bakcopy(), be_tls_open_server(), be_tls_read(), be_tls_write(), check_agglevels_and_constraints(), check_key_sha1(), check_srf_call_placement(), combo_init(), CreateSubscription(), DecodeXLogRecord(), DecodingContextFindStartpoint(), decrypt_internal(), DropSubscription(), encrypt_and_write_elgamal(), encrypt_and_write_rsa(), encrypt_internal(), find_provider(), freev(), init_parallel_dump_utils(), init_work(), initialize_SSL(), libpqrcv_check_conninfo(), libpqrcv_connect(), libpqrcv_get_dbname_from_conninfo(), ListenServerPort(), llvm_optimize_module(), LogicalRepSyncTableStart(), LookupWSErrorMessage(), main(), mkdirs(), my_BIO_s_socket(), my_SSL_set_fd(), NIAddAffix(), open_client_SSL(), ossl_aes_cbc_init(), ossl_aes_ecb_init(), pg_decrypt(), pg_decrypt_iv(), pg_encrypt(), pg_encrypt_iv(), pg_sync_replication_slots(), pgp_elgamal_decrypt(), pgp_elgamal_encrypt(), pgp_load_cipher(), pgp_load_digest(), pgp_rsa_decrypt(), pgp_rsa_encrypt(), pgp_set_s2k_mode(), pgp_write_pubenc_sesskey(), pgstat_relation(), pgtls_read(), pgtls_write(), pgtypes_defmt_scan(), PGTYPESnumeric_div(), PGTYPEStimestamp_defmt_scan(), PostmasterMain(), PQconnectPoll(), px_crypt_md5(), px_find_combo(), px_find_hmac(), px_strerror(), px_THROW_ERROR(), read_pubkey_keyid(), ReadPageInternal(), ReplSlotSyncWorkerMain(), ReportSlotConnectionError(), run_apply_worker(), set_dl_error(), setup_config(), SN_set_current(), startup_hacks(), transformColumnRef(), transformSubLink(), transformWindowFuncCall(), tzload(), tzloadbody(), WalReceiverMain(), winsock_strerror(), XLogDecodeNextRecord(), and XLogFindNextRecord().

◆ errx()

void errx ( int  eval,
const char *  fmt,
  ... 
)

Definition at line 58 of file err.c.

59 {
60  va_list ap;
61  va_start(ap, fmt);
62  if (fmt != NULL)
63  vfprintf(stderr, fmt, ap);
64  fprintf(stderr, "\n");
65  va_end(ap);
66  exit(eval);
67 }

References exit(), fmt, fprintf, va_end(), va_start(), and vfprintf().

Referenced by fill_buffer(), lookahead(), main(), parse(), and set_option().