mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-18 15:16:17 +00:00
Fixed brackets in autoconf scripts.
This commit is contained in:
+12
-12
@@ -103,22 +103,22 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
|
|||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
int main() {
|
int main() {
|
||||||
struct kevent ev[2], ev_out[2];
|
struct kevent ev@<:@2@:>@, ev_out@<:@2@:>@;
|
||||||
struct timespec ts = { 0, 0 };
|
struct timespec ts = { 0, 0 };
|
||||||
int pfd[2], pty[2], kfd, n;
|
int pfd@<:@2@:>@, pty@<:@2@:>@, kfd, n;
|
||||||
char buffer[9001];
|
char buffer@<:@9001@:>@;
|
||||||
if (pipe(pfd) == -1) return 1;
|
if (pipe(pfd) == -1) return 1;
|
||||||
if (fcntl(pfd[1], F_SETFL, O_NONBLOCK) == -1) return 2;
|
if (fcntl(pfd@<:@1@:>@, F_SETFL, O_NONBLOCK) == -1) return 2;
|
||||||
while ((n = write(pfd[1], buffer, sizeof(buffer))) == sizeof(buffer));
|
while ((n = write(pfd@<:@1@:>@, buffer, sizeof(buffer))) == sizeof(buffer));
|
||||||
if ((pty[0]=posix_openpt(O_RDWR | O_NOCTTY)) == -1) return 3;
|
if ((pty@<:@0@:>@=posix_openpt(O_RDWR | O_NOCTTY)) == -1) return 3;
|
||||||
if ((pty[1]=grantpt(pty[0])) == -1) return 4;
|
if ((pty@<:@1@:>@=grantpt(pty@<:@0@:>@)) == -1) return 4;
|
||||||
EV_SET(ev+0, pfd[1], EVFILT_WRITE, EV_ADD | EV_ENABLE, 0, 0, NULL);
|
EV_SET(ev+0, pfd@<:@1@:>@, EVFILT_WRITE, EV_ADD | EV_ENABLE, 0, 0, NULL);
|
||||||
EV_SET(ev+1, pty[1], EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, NULL);
|
EV_SET(ev+1, pty@<:@1@:>@, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, NULL);
|
||||||
if ((kfd = kqueue()) == -1) return 5;
|
if ((kfd = kqueue()) == -1) return 5;
|
||||||
if ((n = kevent(kfd, ev, 2, NULL, 0, NULL)) == -1) return 6;
|
if ((n = kevent(kfd, ev, 2, NULL, 0, NULL)) == -1) return 6;
|
||||||
if (ev_out[0].flags & EV_ERROR) return 7;
|
if (ev_out@<:@0@:>@.flags & EV_ERROR) return 7;
|
||||||
if (ev_out[1].flags & EV_ERROR) return 8;
|
if (ev_out@<:@1@:>@.flags & EV_ERROR) return 8;
|
||||||
read(pfd[0], buffer, sizeof(buffer));
|
read(pfd@<:@0@:>@, buffer, sizeof(buffer));
|
||||||
if ((n = kevent(kfd, NULL, 0, ev_out, 2, &ts)) < 1) return 9;
|
if ((n = kevent(kfd, NULL, 0, ev_out, 2, &ts)) < 1) return 9;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-4
@@ -170,8 +170,8 @@ AC_DEFUN([TORRENT_CHECK_MADVISE], [
|
|||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
void f() { static char test[1024]; madvise((void *)test, sizeof(test), MADV_NORMAL); }
|
void f() { static char test@<:@1024@:>@; madvise((void *)test, sizeof(test), MADV_NORMAL); }
|
||||||
])],
|
])],
|
||||||
[
|
[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
@@ -241,7 +241,7 @@ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
|
|||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
int main() {
|
int main() {
|
||||||
char buf[8] = { 0, 0, 0, 0, 1, 0, 0, 0 };
|
char buf@<:@8@:>@ = { 0, 0, 0, 0, 1, 0, 0, 0 };
|
||||||
int i;
|
int i;
|
||||||
for (i = 1; i < 4; ++i)
|
for (i = 1; i < 4; ++i)
|
||||||
if (*(uint32_t*)(buf + i) == 0) return -1;
|
if (*(uint32_t*)(buf + i) == 0) return -1;
|
||||||
@@ -307,5 +307,6 @@ AC_DEFUN([TORRENT_ENABLE_CXX11], [
|
|||||||
fi
|
fi
|
||||||
],[
|
],[
|
||||||
TORRENT_CHECK_CXX11()
|
TORRENT_CHECK_CXX11()
|
||||||
])
|
]
|
||||||
|
)
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user