~ubuntu-branches/ubuntu/trusty/gnupg/trusty-updates

« back to all changes in this revision

Viewing changes to util/ttyio.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-12-04 22:26:16 UTC
  • mfrom: (1.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20121204222616-cr0fow26geq90l3y
Tags: 1.4.12-6ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Disable mlock() test since it fails with ulimit 0 (on buildds).
  - Set gpg (or gpg2) and gpgsm to use a passphrase agent by default.
  - Only suggest gnupg-curl and libldap; recommendations are pulled into
    minimal, and we don't need the keyserver utilities in a minimal Ubuntu
    system.
  - Remove the Win32 build.
  - Update config.guess/config.sub for aarch64.
* Dropped patches:
  - Fix udeb build failure on powerpc, building with -O2 instead of -Os.
    (No longer seems to be necessary.)
* Simplify removal of Win32 build, to make this easier to merge in future.

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
#else
186
186
    ttyfp = batchmode? stderr : fopen( tty_get_ttyname (), "r+");
187
187
    if( !ttyfp ) {
188
 
        log_error("cannot open `%s': %s\n",
 
188
        ttyfp = stderr;  /* Use stderr as fallback for log_error.  */
 
189
        initialized = 1; /* Make sure log_error won't try to init
 
190
                            the tty again.  */
 
191
        log_error("cannot open tty `%s': %s\n",
189
192
                  tty_get_ttyname (), strerror(errno) );
190
193
        exit(2);
191
194
    }
258
261
 
259
262
    va_start( arg_ptr, fmt ) ;
260
263
#ifdef _WIN32
261
 
    {   
 
264
    {
262
265
        char *buf;
263
266
        int n;
264
267
        DWORD nwritten;
267
270
        if (!buf)
268
271
          log_bug("xtryvasprintf() failed\n");
269
272
        n = strlen (buf);
270
 
        
 
273
 
271
274
        if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
272
275
            log_fatal ("WriteConsole failed: %s", w32_strerror (0));
273
276
        if( n != nwritten )
306
309
 
307
310
    va_start( arg_ptr, fmt ) ;
308
311
#ifdef _WIN32
309
 
    {   
 
312
    {
310
313
        char *buf;
311
314
        int n;
312
315
        DWORD nwritten;
315
318
        if (!buf)
316
319
          log_bug ("xtryvasprintf() failed\n");
317
320
        n = strlen (buf);
318
 
        
 
321
 
319
322
        if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
320
323
            log_fatal ("WriteConsole failed: %s", w32_strerror (0));
321
324
        if (n != nwritten)