connection.c

ソースコードを見る。


関数

int claim_connection (char *fname, int max_connections)

関数

int claim_connection ( char *  fname,
int  max_connections 
)

connection.c26 行で定義されています。

参照先 errnolock_range().

参照元 rsync_module().

00027 {
00028         int fd, i;
00029 
00030         if (max_connections <= 0)
00031                 return 1;
00032 
00033         fd = open(fname,O_RDWR|O_CREAT, 0600);
00034 
00035         if (fd == -1) {
00036                 return 0;
00037         }
00038 
00039         /* find a free spot */
00040         for (i=0;i<max_connections;i++) {
00041                 if (lock_range(fd, i*4, 4)) return 1;
00042         }               
00043 
00044         /* only interested in open failures */
00045         errno = 0;
00046 
00047         close(fd);
00048         return 0;
00049 }


rsyncに対してSat Dec 5 19:45:43 2009に生成されました。  doxygen 1.4.7