~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/my_lock.c

Removed non-fcntl code and made it a fatal configure error if it's not there.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include <my_sys.h>
18
18
#include <mysys_err.h>
19
19
 
20
 
#include <errno.h>
21
 
#undef MY_HOW_OFTEN_TO_ALARM
22
 
#define MY_HOW_OFTEN_TO_ALARM ((int) my_time_to_wait_for_lock)
23
 
#ifdef NO_ALARM_LOOP
24
 
#undef NO_ALARM_LOOP
25
 
#endif
26
 
 
27
20
 
28
21
/*
29
22
  Lock a part of a file
46
39
  if (my_disable_locking)
47
40
    DBUG_RETURN(0);
48
41
 
49
 
#if defined(HAVE_FCNTL)
50
42
  {
51
43
    struct flock lock;
52
44
 
73
65
    else if (fcntl(fd,F_SETLKW,&lock) != -1) /* Wait until a lock */
74
66
      DBUG_RETURN(0);
75
67
  }
76
 
#else
77
 
  if (MyFlags & MY_SEEK_NOT_DONE)
78
 
  {
79
 
    if (my_seek(fd,start,MY_SEEK_SET,MYF(MyFlags & ~MY_SEEK_NOT_DONE))
80
 
        == MY_FILEPOS_ERROR)
81
 
    {
82
 
      /*
83
 
        If an error has occured in my_seek then we will already
84
 
        have an error code in my_errno; Just return error code.
85
 
      */
86
 
      DBUG_RETURN(-1);
87
 
    }
88
 
  }
89
 
  if (lockf(fd,locktype,length) != -1)
90
 
    DBUG_RETURN(0);
91
 
#endif /* HAVE_FCNTL */
92
68
 
93
69
        /* We got an error. We don't want EACCES errors */
94
70
  my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1;