[0] | 1 | //simple.c: |
---|
| 2 | |
---|
[690] | 3 | /* |
---|
[4708] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2011 |
---|
[690] | 5 | * |
---|
| 6 | * This file is part of libroar a part of RoarAudio, |
---|
| 7 | * a cross-platform sound system for both, home and professional use. |
---|
| 8 | * See README for details. |
---|
| 9 | * |
---|
| 10 | * This file is free software; you can redistribute it and/or modify |
---|
| 11 | * it under the terms of the GNU General Public License version 3 |
---|
| 12 | * as published by the Free Software Foundation. |
---|
| 13 | * |
---|
| 14 | * libroar is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this software; see the file COPYING. If not, write to |
---|
[3517] | 21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 22 | * Boston, MA 02110-1301, USA. |
---|
[690] | 23 | * |
---|
| 24 | * NOTE for everyone want's to change something and send patches: |
---|
| 25 | * read README and HACKING! There a addition information on |
---|
| 26 | * the license of this document you need to read before you send |
---|
| 27 | * any patches. |
---|
| 28 | * |
---|
| 29 | * NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc |
---|
| 30 | * or libpulse*: |
---|
| 31 | * The libs libroaresd, libroararts and libroarpulse link this lib |
---|
| 32 | * and are therefore GPL. Because of this it may be illigal to use |
---|
| 33 | * them with any software that uses libesd, libartsc or libpulse*. |
---|
| 34 | */ |
---|
| 35 | |
---|
[0] | 36 | #include "libroar.h" |
---|
| 37 | |
---|
| 38 | int roar_simple_connect (struct roar_connection * con, char * server, char * name) { |
---|
[4806] | 39 | return roar_simple_connect2(con, server, name, 0, 0); |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | int roar_simple_connect2(struct roar_connection * con, char * server, char * name, int flags, uint_least32_t timeout) { |
---|
[0] | 43 | |
---|
| 44 | ROAR_DBG("roar_simple_connect(*): trying to connect..."); |
---|
| 45 | |
---|
[4806] | 46 | if ( roar_connect2(con, server, flags, timeout) == -1 ) { |
---|
[0] | 47 | ROAR_DBG("roar_simple_connect(*): roar_connect() faild!"); |
---|
| 48 | return -1; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | if ( roar_identify(con, name) == -1 ) { |
---|
| 52 | ROAR_DBG("roar_simple_connect(*): roar_identify() faild!"); |
---|
| 53 | return -1; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | if ( roar_auth(con) == -1 ) { |
---|
| 57 | ROAR_DBG("roar_simple_connect(*): roar_auth() faild!"); |
---|
| 58 | return -1; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | return 0; |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | int roar_simple_stream(int rate, int channels, int bits, int codec, char * server, int dir, char * name) { |
---|
[1158] | 65 | struct roar_stream s; |
---|
| 66 | |
---|
[2818] | 67 | roar_debug_warn_sysio("roar_simple_stream", "roar_vio_simple_stream", NULL); |
---|
| 68 | |
---|
[1158] | 69 | return roar_simple_stream_obj(&s, rate, channels, bits, codec, server, dir, name); |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | int roar_simple_stream_obj (struct roar_stream * s, int rate, int channels, int bits, int codec, char * server, int dir, char * name) { |
---|
[0] | 73 | struct roar_connection con; |
---|
[1660] | 74 | int ret; |
---|
[0] | 75 | |
---|
[2818] | 76 | roar_debug_warn_sysio("roar_simple_stream_obj", NULL, NULL); |
---|
| 77 | |
---|
[0] | 78 | if ( roar_simple_connect(&con, server, name) == -1 ) { |
---|
| 79 | ROAR_DBG("roar_simple_play(*): roar_simple_connect() faild!"); |
---|
[1094] | 80 | ROAR_ERR("roar_simple_stream(*): Can not connect to server"); |
---|
[0] | 81 | return -1; |
---|
| 82 | } |
---|
| 83 | |
---|
[1158] | 84 | if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) { |
---|
[0] | 85 | roar_disconnect(&con); |
---|
| 86 | return -1; |
---|
| 87 | } |
---|
| 88 | |
---|
[1158] | 89 | if ( roar_stream_connect(&con, s, dir) == -1 ) { |
---|
[0] | 90 | roar_disconnect(&con); |
---|
| 91 | return -1; |
---|
| 92 | } |
---|
| 93 | |
---|
[1158] | 94 | if ( roar_stream_exec(&con, s) == -1 ) { |
---|
[0] | 95 | roar_disconnect(&con); |
---|
| 96 | return -1; |
---|
| 97 | } |
---|
| 98 | |
---|
[3857] | 99 | roar_libroar_nowarn(); |
---|
[1660] | 100 | if ( (ret = roar_get_connection_fh(&con)) == -1 ) { |
---|
[3857] | 101 | roar_libroar_warn(); |
---|
[1660] | 102 | roar_disconnect(&con); |
---|
| 103 | return -1; |
---|
[54] | 104 | } |
---|
[3857] | 105 | roar_libroar_warn(); |
---|
[54] | 106 | |
---|
[1660] | 107 | if ( dir == ROAR_DIR_PLAY ) { |
---|
| 108 | ROAR_SHUTDOWN(ret, SHUT_RD); |
---|
| 109 | } else if ( dir == ROAR_DIR_MONITOR || dir == ROAR_DIR_RECORD ) { |
---|
| 110 | ROAR_SHUTDOWN(ret, SHUT_WR); |
---|
| 111 | } |
---|
| 112 | |
---|
| 113 | return ret; |
---|
[0] | 114 | } |
---|
| 115 | |
---|
[1163] | 116 | int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir) { |
---|
| 117 | int fh; |
---|
| 118 | |
---|
[1476] | 119 | if ( (fh = roar_simple_stream_obj(s, rate, channels, bits, codec, NULL /* server, we hope this is ok here... */, |
---|
[1163] | 120 | dir, "libroar temp stream")) == -1 ) |
---|
| 121 | return -1; |
---|
| 122 | |
---|
| 123 | if ( roar_stream_attach_simple(con, s, roar_get_clientid(con)) == -1 ) { |
---|
[1476] | 124 | #ifdef ROAR_HAVE_IO_POSIX |
---|
[1163] | 125 | close(fh); |
---|
[1476] | 126 | #endif /* no else as we return -1 anyway */ |
---|
[1163] | 127 | return -1; |
---|
| 128 | } |
---|
| 129 | |
---|
[1166] | 130 | s->fh = fh; |
---|
| 131 | |
---|
[1163] | 132 | return fh; |
---|
| 133 | } |
---|
| 134 | |
---|
[82] | 135 | int roar_simple_new_stream (struct roar_connection * con, int rate, int channels, int bits, int codec, int dir) { |
---|
| 136 | struct roar_stream s; |
---|
[3857] | 137 | int ret; |
---|
| 138 | |
---|
| 139 | roar_debug_warn_sysio("roar_simple_new_stream", "roar_vio_simple_new_stream_obj", NULL); |
---|
| 140 | |
---|
| 141 | roar_libroar_nowarn(); |
---|
| 142 | ret = roar_simple_new_stream_obj(con, &s, rate, channels, bits, codec, dir); |
---|
| 143 | roar_libroar_warn(); |
---|
| 144 | |
---|
| 145 | return ret; |
---|
[119] | 146 | } |
---|
| 147 | |
---|
| 148 | int roar_simple_new_stream_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir) { |
---|
[2481] | 149 | struct roar_libroar_config * config = roar_libroar_get_config(); |
---|
[1168] | 150 | char file[80] = {0}; |
---|
| 151 | int fh = -1, listen = -1; |
---|
[82] | 152 | static int count = 0; |
---|
[487] | 153 | int type = ROAR_SOCKET_TYPE_UNIX; |
---|
| 154 | int port = 0; |
---|
[1396] | 155 | #if defined(ROAR_HAVE_IPV4) || defined(ROAR_HAVE_LIBDNET) |
---|
[493] | 156 | int opt = 1; |
---|
[1396] | 157 | #endif |
---|
[1466] | 158 | #ifdef ROAR_HAVE_IPV4 |
---|
[487] | 159 | struct sockaddr_in socket_addr; |
---|
| 160 | socklen_t len = sizeof(struct sockaddr_in); |
---|
[1466] | 161 | #else |
---|
| 162 | struct sockaddr socket_addr; |
---|
| 163 | socklen_t len = sizeof(struct sockaddr); |
---|
| 164 | #endif |
---|
[1465] | 165 | #ifdef ROAR_HAVE_SELECT |
---|
[1161] | 166 | fd_set fds; |
---|
| 167 | struct timeval timeout = {10, 0}; |
---|
[1465] | 168 | struct roar_message mes; |
---|
| 169 | #endif |
---|
[1396] | 170 | #ifdef ROAR_HAVE_UNIX |
---|
[1168] | 171 | int socks[2]; // for socketpair() |
---|
[1396] | 172 | #endif |
---|
[82] | 173 | |
---|
[3479] | 174 | // make valgrind happy |
---|
| 175 | memset(&socket_addr, 0, sizeof(socket_addr)); |
---|
[3897] | 176 | #ifdef ROAR_HAVE_SELECT |
---|
[3479] | 177 | memset(&mes, 0, sizeof(mes)); |
---|
[3897] | 178 | #endif |
---|
[3479] | 179 | |
---|
[3012] | 180 | roar_debug_warn_sysio("roar_simple_new_stream_obj", "roar_vio_simple_new_stream_obj", NULL); |
---|
| 181 | |
---|
[2481] | 182 | if ( config != NULL ) { |
---|
| 183 | if ( config->workaround.workarounds & ROAR_LIBROAR_CONFIG_WAS_USE_EXECED ) { |
---|
| 184 | return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir); |
---|
| 185 | } |
---|
| 186 | } |
---|
| 187 | |
---|
[1476] | 188 | #ifdef ROAR_HAVE_BSDSOCKETS |
---|
[3857] | 189 | roar_libroar_nowarn(); |
---|
[1660] | 190 | if ( getsockname(roar_get_connection_fh(con), (struct sockaddr *)&socket_addr, &len) == -1 ) { |
---|
[3857] | 191 | roar_libroar_warn(); |
---|
[82] | 192 | return -1; |
---|
| 193 | } |
---|
[3857] | 194 | roar_libroar_warn(); |
---|
[1476] | 195 | #else |
---|
| 196 | return -1; |
---|
| 197 | #endif |
---|
[82] | 198 | |
---|
[1178] | 199 | if ( len == 0 ) { |
---|
| 200 | #ifdef ROAR_OS_OPENBSD |
---|
| 201 | ROAR_WARN("roar_simple_new_stream_obj(*): Unknown address family: guess AF_UNIX because OS is OpenBSD"); |
---|
[1466] | 202 | ((struct sockaddr*)&socket_addr)->sa_family = AF_UNIX; |
---|
[1178] | 203 | #else |
---|
[505] | 204 | return -1; |
---|
[1178] | 205 | #endif |
---|
| 206 | } |
---|
| 207 | |
---|
[1466] | 208 | switch (((struct sockaddr*)&socket_addr)->sa_family) { |
---|
[1359] | 209 | #ifdef ROAR_HAVE_UNIX |
---|
[1178] | 210 | case AF_UNIX: type = ROAR_SOCKET_TYPE_UNIX; break; |
---|
[1359] | 211 | #endif |
---|
| 212 | #ifdef ROAR_HAVE_IPV4 |
---|
[1178] | 213 | case AF_INET: type = ROAR_SOCKET_TYPE_INET; break; |
---|
[1359] | 214 | #endif |
---|
| 215 | #ifdef ROAR_HAVE_LIBDNET |
---|
[1178] | 216 | case AF_DECnet: type = ROAR_SOCKET_TYPE_DECNET; break; |
---|
[1359] | 217 | #endif |
---|
[1178] | 218 | default: |
---|
| 219 | return -1; |
---|
| 220 | break; |
---|
[487] | 221 | } |
---|
| 222 | |
---|
[1187] | 223 | if ( type == ROAR_SOCKET_TYPE_DECNET ) { |
---|
[526] | 224 | if ( roar_socket_get_local_nodename() ) { |
---|
[1067] | 225 | snprintf(file, 24,"%s::roar$TMP%04x%02x", roar_socket_get_local_nodename(), getpid(), count++); |
---|
[526] | 226 | } else { |
---|
| 227 | return -1; |
---|
| 228 | } |
---|
[1380] | 229 | #ifdef ROAR_HAVE_IPV4 |
---|
[487] | 230 | } else { |
---|
[1068] | 231 | strncpy(file, inet_ntoa(socket_addr.sin_addr), 79); |
---|
[1380] | 232 | #endif |
---|
[487] | 233 | } |
---|
| 234 | |
---|
[1168] | 235 | if ( type != ROAR_SOCKET_TYPE_UNIX ) { |
---|
| 236 | if ( (listen = roar_socket_listen(type, file, port)) == -1 ) { |
---|
| 237 | return -1; |
---|
| 238 | } |
---|
[487] | 239 | } |
---|
[451] | 240 | |
---|
[487] | 241 | if ( type == ROAR_SOCKET_TYPE_INET ) { |
---|
[1380] | 242 | #ifdef ROAR_HAVE_IPV4 |
---|
[487] | 243 | len = sizeof(struct sockaddr_in); |
---|
[3905] | 244 | setsockopt(listen, SOL_SOCKET, SO_REUSEADDR, (void*)&opt, sizeof(int)); |
---|
[493] | 245 | |
---|
[487] | 246 | if ( getsockname(listen, (struct sockaddr *)&socket_addr, &len) == -1 ) { |
---|
| 247 | return -1; |
---|
| 248 | } |
---|
| 249 | port = ROAR_NET2HOST16(socket_addr.sin_port); |
---|
| 250 | ROAR_DBG("roar_simple_new_stream_obj(*): port=%i", port); |
---|
[1380] | 251 | #else |
---|
| 252 | return -1; |
---|
| 253 | #endif |
---|
[532] | 254 | } else if ( type == ROAR_SOCKET_TYPE_DECNET ) { |
---|
[1395] | 255 | #ifdef ROAR_HAVE_LIBDNET |
---|
[532] | 256 | len = sizeof(struct sockaddr_in); |
---|
| 257 | setsockopt(listen, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int)); |
---|
[1395] | 258 | #else |
---|
| 259 | return -1; |
---|
| 260 | #endif |
---|
[487] | 261 | } |
---|
[451] | 262 | |
---|
[119] | 263 | if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) { |
---|
[82] | 264 | return -1; |
---|
| 265 | } |
---|
| 266 | |
---|
[119] | 267 | if ( roar_stream_connect(con, s, dir) == -1 ) { |
---|
[82] | 268 | return -1; |
---|
| 269 | } |
---|
| 270 | |
---|
[1168] | 271 | if ( type != ROAR_SOCKET_TYPE_UNIX ) { |
---|
[1465] | 272 | #ifdef ROAR_HAVE_SELECT |
---|
[1168] | 273 | if ( roar_stream_connect_to_ask(con, s, type, file, port) != -1 ) { |
---|
[1161] | 274 | |
---|
[1168] | 275 | FD_ZERO(&fds); |
---|
| 276 | FD_SET(listen, &fds); |
---|
[1163] | 277 | |
---|
[1168] | 278 | if ( select(listen + 1, &fds, &fds, &fds, &timeout) < 1 ) { |
---|
| 279 | close(listen); |
---|
[1163] | 280 | |
---|
[1168] | 281 | // we don't need to check the content as we know it failed... |
---|
| 282 | if ( roar_recv_message(con, &mes, NULL) == -1 ) |
---|
| 283 | return -1; |
---|
[1161] | 284 | |
---|
[1168] | 285 | if ( roar_kick(con, ROAR_OT_STREAM, s->id) == -1 ) |
---|
| 286 | return -1; |
---|
[1161] | 287 | |
---|
[1168] | 288 | return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir); |
---|
[82] | 289 | } |
---|
[1168] | 290 | |
---|
| 291 | if ( (fh = accept(listen, NULL, NULL)) != -1 ) { |
---|
| 292 | /* errr, do we need we any error handling here? */ |
---|
| 293 | } |
---|
[82] | 294 | if ( roar_recv_message(con, &mes, NULL) == -1 ) { |
---|
| 295 | close(fh); |
---|
| 296 | fh = -1; |
---|
| 297 | } else if ( mes.cmd != ROAR_CMD_OK ) { |
---|
| 298 | close(fh); |
---|
| 299 | fh = -1; |
---|
| 300 | } |
---|
[1168] | 301 | } |
---|
| 302 | |
---|
| 303 | close(listen); |
---|
[1465] | 304 | #else |
---|
| 305 | return -1; |
---|
| 306 | #endif |
---|
[1168] | 307 | } else { // this is type == ROAR_SOCKET_TYPE_UNIX |
---|
[1395] | 308 | #ifdef ROAR_HAVE_UNIX |
---|
[1168] | 309 | if ( socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1 ) { |
---|
| 310 | roar_kick(con, ROAR_OT_STREAM, s->id); // we do not need to check for errors |
---|
| 311 | // as we return -1 in both whys |
---|
| 312 | return -1; |
---|
| 313 | } |
---|
| 314 | |
---|
| 315 | if ( roar_stream_passfh(con, s, socks[0]) == -1 ) { |
---|
| 316 | roar_kick(con, ROAR_OT_STREAM, s->id); // we do not need to check for errors |
---|
[3651] | 317 | // as we return -1 anyway. |
---|
| 318 | close(socks[0]); |
---|
| 319 | close(socks[1]); |
---|
[1168] | 320 | return -1; |
---|
| 321 | } |
---|
| 322 | |
---|
| 323 | close(socks[0]); |
---|
| 324 | fh = socks[1]; |
---|
[1395] | 325 | #else |
---|
| 326 | roar_kick(con, ROAR_OT_STREAM, s->id); |
---|
| 327 | return -1; |
---|
| 328 | #endif |
---|
[82] | 329 | } |
---|
| 330 | |
---|
[1168] | 331 | /* |
---|
[487] | 332 | if ( type == ROAR_SOCKET_TYPE_UNIX ) { |
---|
| 333 | unlink(file); |
---|
| 334 | } |
---|
[1168] | 335 | */ |
---|
| 336 | |
---|
| 337 | if ( dir == ROAR_DIR_PLAY ) { |
---|
[1470] | 338 | ROAR_SHUTDOWN(fh, SHUT_RD); |
---|
[1168] | 339 | } else if ( dir == ROAR_DIR_MONITOR || dir == ROAR_DIR_RECORD ) { |
---|
[1470] | 340 | ROAR_SHUTDOWN(fh, SHUT_WR); |
---|
[1168] | 341 | } |
---|
[82] | 342 | |
---|
[505] | 343 | s->fh = fh; |
---|
| 344 | |
---|
[82] | 345 | return fh; |
---|
| 346 | } |
---|
| 347 | |
---|
[235] | 348 | |
---|
| 349 | int roar_simple_play_file(char * file, char * server, char * name) { |
---|
| 350 | struct roar_connection con; |
---|
| 351 | |
---|
| 352 | if ( roar_simple_connect(&con, server, name) == -1 ) { |
---|
| 353 | return -1; |
---|
| 354 | } |
---|
| 355 | |
---|
| 356 | return roar_file_play(&con, file, 1); // con is closed by this as this stream will be an execed one. |
---|
| 357 | } |
---|
| 358 | |
---|
[0] | 359 | int roar_simple_play(int rate, int channels, int bits, int codec, char * server, char * name) { |
---|
[2655] | 360 | roar_debug_warn_sysio("roar_simple_play", "roar_vio_simple_stream", NULL); |
---|
| 361 | |
---|
[0] | 362 | return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_PLAY, name); |
---|
| 363 | } |
---|
| 364 | |
---|
| 365 | int roar_simple_monitor(int rate, int channels, int bits, int codec, char * server, char * name) { |
---|
[2655] | 366 | roar_debug_warn_sysio("roar_simple_monitor", "roar_vio_simple_stream", NULL); |
---|
| 367 | |
---|
[0] | 368 | return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_MONITOR, name); |
---|
| 369 | } |
---|
| 370 | |
---|
| 371 | int roar_simple_record(int rate, int channels, int bits, int codec, char * server, char * name) { |
---|
[2655] | 372 | roar_debug_warn_sysio("roar_simple_record", "roar_vio_simple_stream", NULL); |
---|
| 373 | |
---|
[0] | 374 | return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_RECORD, name); |
---|
| 375 | } |
---|
| 376 | |
---|
| 377 | int roar_simple_filter(int rate, int channels, int bits, int codec, char * server, char * name) { |
---|
[2655] | 378 | roar_debug_warn_sysio("roar_simple_filter", "roar_vio_simple_stream", NULL); |
---|
| 379 | |
---|
[0] | 380 | return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_FILTER, name); |
---|
| 381 | } |
---|
| 382 | |
---|
[2697] | 383 | int roar_simple_connect_virtual(struct roar_connection * con, struct roar_stream * s, int parent, int dir) { |
---|
[2656] | 384 | struct roar_stream parent_stream; |
---|
| 385 | |
---|
| 386 | if ( con == NULL || s == NULL || parent < 0 ) |
---|
| 387 | return -1; |
---|
| 388 | |
---|
[2697] | 389 | if ( dir == -1 ) { |
---|
| 390 | if ( roar_get_stream(con, &parent_stream, parent) == -1 ) |
---|
| 391 | return -1; |
---|
[2656] | 392 | |
---|
[2697] | 393 | if ( (dir = roar_stream_get_dir(&parent_stream)) == -1 ) |
---|
| 394 | return -1; |
---|
| 395 | } |
---|
[2656] | 396 | |
---|
| 397 | if ( roar_stream_set_rel_id(s, parent) == -1 ) |
---|
| 398 | return -1; |
---|
| 399 | |
---|
| 400 | if ( roar_stream_connect(con, s, dir) == -1 ) |
---|
| 401 | return -1; |
---|
| 402 | |
---|
| 403 | if ( roar_stream_set_flags(con, s, ROAR_FLAG_VIRTUAL, 0) == -1 ) { |
---|
| 404 | roar_kick(con, ROAR_OT_STREAM, roar_stream_get_id(s)); |
---|
| 405 | return -1; |
---|
| 406 | } |
---|
| 407 | |
---|
| 408 | return 0; |
---|
[2647] | 409 | } |
---|
[0] | 410 | |
---|
| 411 | int roar_simple_close(int fh) { |
---|
[2655] | 412 | roar_debug_warn_sysio("roar_simple_close", "roar_vio_close", NULL); |
---|
| 413 | |
---|
[1763] | 414 | #ifdef ROAR_TARGET_WIN32 |
---|
| 415 | closesocket(fh); |
---|
| 416 | return 0; |
---|
| 417 | #else |
---|
| 418 | |
---|
[1476] | 419 | #ifdef ROAR_HAVE_IO_POSIX |
---|
[0] | 420 | return close(fh); |
---|
[1476] | 421 | #else |
---|
| 422 | return -1; |
---|
| 423 | #endif |
---|
[1763] | 424 | |
---|
| 425 | #endif |
---|
[0] | 426 | } |
---|
| 427 | |
---|
| 428 | int roar_simple_get_standby (int fh) { |
---|
| 429 | struct roar_connection con; |
---|
| 430 | |
---|
[2809] | 431 | roar_debug_warn_sysio("roar_simple_get_standby", "roar_get_standby", NULL); |
---|
[2655] | 432 | |
---|
[1660] | 433 | if ( roar_connect_fh(&con, fh) == -1 ) |
---|
| 434 | return -1; |
---|
[0] | 435 | |
---|
| 436 | return roar_get_standby(&con); |
---|
| 437 | } |
---|
| 438 | |
---|
| 439 | //ll |
---|