~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to file.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
  file.c -
4
4
 
5
 
  $Author: nobu $
6
 
  $Date: 2007-05-19 01:04:22 +0900 (土, 19  5月 2007) $
 
5
  $Author: ko1 $
 
6
  $Date: 2007-08-28 01:48:14 +0900 (火, 28  8月 2007) $
7
7
  created at: Mon Nov 15 12:24:34 JST 1993
8
8
 
9
 
  Copyright (C) 1993-2003 Yukihiro Matsumoto
 
9
  Copyright (C) 1993-2007 Yukihiro Matsumoto
10
10
  Copyright (C) 2000  Network Applied Communication Laboratory, Inc.
11
11
  Copyright (C) 2000  Information-technology Promotion Agency, Japan
12
12
 
16
16
#include "missing/file.h"
17
17
#endif
18
18
 
19
 
#include "ruby.h"
20
 
#include "rubyio.h"
21
 
#include "rubysig.h"
22
 
#include "util.h"
 
19
#include "ruby/ruby.h"
 
20
#include "ruby/io.h"
 
21
#include "ruby/signal.h"
 
22
#include "ruby/util.h"
23
23
#include "dln.h"
24
24
 
25
25
#ifdef HAVE_UNISTD_H
785
785
#endif
786
786
}
787
787
 
 
788
#ifndef HAVE_GROUP_MEMBER
788
789
static int
789
790
group_member(GETGROUPS_T gid)
790
791
{
813
814
#endif
814
815
    return Qfalse;
815
816
}
 
817
#endif
816
818
 
817
819
#ifndef S_IXUGO
818
820
#  define S_IXUGO               (S_IXUSR | S_IXGRP | S_IXOTH)
2214
2216
    errno = 0;
2215
2217
#endif
2216
2218
    if (rename(src, dst) < 0) {
2217
 
#if defined __CYGWIN__
2218
 
        extern unsigned long __attribute__((stdcall)) GetLastError(void);
2219
 
        if (errno == 0) {       /* This is a bug of old Cygwin */
2220
 
            /* incorrect as cygwin errno, but the last resort */
2221
 
            errno = GetLastError();
2222
 
        }
2223
 
#elif defined DOSISH && !defined _WIN32
2224
 
        if (errno == EEXIST
 
2219
#if defined DOSISH && !defined _WIN32
 
2220
        switch (errno) {
 
2221
          case EEXIST:
2225
2222
#if defined (__EMX__)
2226
 
            || errno == EACCES
 
2223
          case EACCES:
2227
2224
#endif
2228
 
            ) {
2229
2225
            if (chmod(dst, 0666) == 0 &&
2230
2226
                unlink(dst) == 0 &&
2231
2227
                rename(src, dst) == 0)
3088
3084
 
3089
3085
#ifdef __CYGWIN__
3090
3086
#include <winerror.h>
 
3087
extern unsigned long __attribute__((stdcall)) GetLastError(void);
3091
3088
#endif
3092
3089
 
3093
3090
static VALUE
3151
3148
    if (fptr->mode & FMODE_WRITABLE) {
3152
3149
        rb_io_flush(obj);
3153
3150
    }
3154
 
    while ((int)rb_thread_blocking_region(rb_thread_flock, op, RB_UBF_DFL) < 0) {
 
3151
    while ((int)rb_thread_blocking_region(rb_thread_flock, op, RB_UBF_DFL, 0) < 0) {
3155
3152
        switch (errno) {
3156
3153
          case EAGAIN:
3157
3154
          case EACCES: