~ubuntu-branches/ubuntu/vivid/gzip/vivid

« back to all changes in this revision

Viewing changes to lib/openat-die.c

  • Committer: Steve Langasek
  • Date: 2012-06-29 02:07:40 UTC
  • mfrom: (4.1.9 sid)
  • Revision ID: steve.langasek@canonical.com-20120629020740-qqikrblzana08v2y
Merge version 1.5-1.1 from Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Report a save- or restore-cwd failure in our openat replacement and then exit.
2
2
 
3
 
   Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
 
3
   Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software: you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
21
21
 
22
22
#include <stdlib.h>
23
23
 
24
 
#include "error.h"
 
24
#ifndef GNULIB_LIBPOSIX
 
25
# include "error.h"
 
26
#endif
 
27
 
25
28
#include "exitfail.h"
26
29
 
27
30
#include "gettext.h"
30
33
void
31
34
openat_save_fail (int errnum)
32
35
{
 
36
#ifndef GNULIB_LIBPOSIX
33
37
  error (exit_failure, errnum,
34
38
         _("unable to record current working directory"));
35
 
 
36
 
  /* The `noreturn' attribute cannot be applied to error, since it returns
 
39
#endif
 
40
  /* _Noreturn cannot be applied to error, since it returns
37
41
     when its first argument is 0.  To help compilers understand that this
38
42
     function does not return, call abort.  Also, the abort is a
39
43
     safety feature if exit_failure is 0 (which shouldn't happen).  */
48
52
void
49
53
openat_restore_fail (int errnum)
50
54
{
 
55
#ifndef GNULIB_LIBPOSIX
51
56
  error (exit_failure, errnum,
52
57
         _("failed to return to initial working directory"));
 
58
#endif
53
59
 
54
60
  /* As above.  */
55
61
  abort ();