Changeset 552e595131c5f1d66eba8e3c22c2b1c509be5153
- Timestamp:
- 09/18/07 18:20:49
(1 year ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1190132449 +0000
- git-parent:
[7c7854e76cda10120edb95c9e3a8ab2345be2631]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1190132449 +0000
- Message:
Replace strerror() with %m (or Linux DVB: strerror_r) - refs #1297
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r16e5180 |
r552e595 |
|
| 378 | 378 | if ((fd == -1) || fstat (fd, &stself.st)) |
|---|
| 379 | 379 | { |
|---|
| 380 | | msg_Err (p_playlist, "cannot stat `%s': %s", psz_name, |
|---|
| 381 | | strerror (errno)); |
|---|
| | 380 | msg_Err (p_playlist, "cannot stat `%s': %m", psz_name); |
|---|
| 382 | 381 | return VLC_EGENERIC; |
|---|
| 383 | 382 | } |
|---|
| … | … | |
| 406 | 405 | if( i_dir_content == -1 ) |
|---|
| 407 | 406 | { |
|---|
| 408 | | msg_Err (p_playlist, "cannot read `%s': %s", psz_name, |
|---|
| 409 | | strerror (errno)); |
|---|
| | 407 | msg_Err (p_playlist, "cannot read `%s': %m", psz_name); |
|---|
| 410 | 408 | return VLC_EGENERIC; |
|---|
| 411 | 409 | } |
|---|
| … | … | |
| 552 | 550 | int err = errno; |
|---|
| 553 | 551 | if (err != ENOTDIR) |
|---|
| 554 | | msg_Err (obj, "%s: %s", path, strerror (err)); |
|---|
| | 552 | msg_Err (obj, "%s: %m", path); |
|---|
| 555 | 553 | else |
|---|
| 556 | 554 | msg_Dbg (obj, "skipping non-directory `%s'", path); |
|---|
| r6ee1e19 |
r552e595 |
|
| 470 | 470 | if ( !( handle = raw1394_new_handle() ) ) |
|---|
| 471 | 471 | { |
|---|
| 472 | | msg_Err( p_access, "raw1394 - failed to get handle: %s.\n", strerror( errno ) ); |
|---|
| | 472 | msg_Err( p_access, "raw1394 - failed to get handle: %m." ); |
|---|
| 473 | 473 | return VLC_EGENERIC; |
|---|
| 474 | 474 | } |
|---|
| … | … | |
| 476 | 476 | if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 ) |
|---|
| 477 | 477 | { |
|---|
| 478 | | msg_Err( p_access, "raw1394 - failed to get port info: %s.\n", strerror( errno ) ); |
|---|
| | 478 | msg_Err( p_access, "raw1394 - failed to get port info: %m.\n" ); |
|---|
| 479 | 479 | raw1394_destroy_handle( handle ); |
|---|
| 480 | 480 | return VLC_EGENERIC; |
|---|
| … | … | |
| 502 | 502 | if ( !handle ) |
|---|
| 503 | 503 | { |
|---|
| 504 | | msg_Err( p_access, "raw1394 - failed to get handle: %s.\n", strerror( errno ) ); |
|---|
| | 504 | msg_Err( p_access, "raw1394 - failed to get handle: %m." ); |
|---|
| 505 | 505 | return NULL; |
|---|
| 506 | 506 | } |
|---|
| … | … | |
| 508 | 508 | if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 ) |
|---|
| 509 | 509 | { |
|---|
| 510 | | msg_Err( p_access, "raw1394 - failed to get port info: %s.\n", strerror( errno ) ); |
|---|
| | 510 | msg_Err( p_access, "raw1394 - failed to get port info: %m." ); |
|---|
| 511 | 511 | raw1394_destroy_handle( handle ); |
|---|
| 512 | 512 | return NULL; |
|---|
| … | … | |
| 516 | 516 | if ( raw1394_set_port( handle, port ) < 0 ) |
|---|
| 517 | 517 | { |
|---|
| 518 | | msg_Err( p_access, "raw1394 - failed to set set port: %s.\n", strerror( errno ) ); |
|---|
| | 518 | msg_Err( p_access, "raw1394 - failed to set set port: %m." ); |
|---|
| 519 | 519 | return NULL; |
|---|
| 520 | 520 | } |
|---|
| r6ee1e19 |
r552e595 |
|
| 434 | 434 | continue; |
|---|
| 435 | 435 | |
|---|
| 436 | | msg_Err( p_access, "poll error: %s", strerror(errno) ); |
|---|
| | 436 | msg_Err( p_access, "poll error: %m" ); |
|---|
| 437 | 437 | return NULL; |
|---|
| 438 | 438 | } |
|---|
| … | … | |
| 493 | 493 | p_sys->i_read_once * TS_PACKET_SIZE ) ) <= 0 ) |
|---|
| 494 | 494 | { |
|---|
| 495 | | msg_Warn( p_access, "read failed (%s)", strerror(errno) ); |
|---|
| | 495 | msg_Warn( p_access, "read failed (%m)" ); |
|---|
| 496 | 496 | block_Release( p_block ); |
|---|
| 497 | 497 | continue; |
|---|
| r6ee1e19 |
r552e595 |
|
| 231 | 231 | if ( write( p_sys->i_ca_handle, p_data, i_size ) != i_size ) |
|---|
| 232 | 232 | { |
|---|
| 233 | | msg_Err( p_access, "cannot write to CAM device (%s)", |
|---|
| 234 | | strerror(errno) ); |
|---|
| | 233 | msg_Err( p_access, "cannot write to CAM device (%m)" ); |
|---|
| 235 | 234 | return VLC_EGENERIC; |
|---|
| 236 | 235 | } |
|---|
| … | … | |
| 276 | 275 | if ( i_size < 5 ) |
|---|
| 277 | 276 | { |
|---|
| 278 | | msg_Err( p_access, "cannot read from CAM device (%d:%s)", i_size, |
|---|
| 279 | | strerror(errno) ); |
|---|
| | 277 | msg_Err( p_access, "cannot read from CAM device (%d:%m)", i_size ); |
|---|
| 280 | 278 | return VLC_EGENERIC; |
|---|
| 281 | 279 | } |
|---|
| … | … | |
| 816 | 814 | if ( i_ret < 0 ) |
|---|
| 817 | 815 | { |
|---|
| 818 | | msg_Err( p_access, "Error sending to CAM: %s", strerror(errno) ); |
|---|
| | 816 | msg_Err( p_access, "Error sending to CAM: %m" ); |
|---|
| 819 | 817 | i_ret = VLC_EGENERIC; |
|---|
| 820 | 818 | } |
|---|
| r6ee1e19 |
r552e595 |
|
| 111 | 111 | if( (p_sys->i_frontend_handle = open(frontend, O_RDWR | O_NONBLOCK)) < 0 ) |
|---|
| 112 | 112 | { |
|---|
| 113 | | msg_Err( p_access, "FrontEndOpen: opening device failed (%s)", |
|---|
| 114 | | strerror(errno) ); |
|---|
| | 113 | msg_Err( p_access, "FrontEndOpen: opening device failed (%m)" ); |
|---|
| 115 | 114 | free( p_frontend ); |
|---|
| 116 | 115 | return VLC_EGENERIC; |
|---|
| … | … | |
| 297 | 296 | return; /* no more events */ |
|---|
| 298 | 297 | |
|---|
| 299 | | msg_Err( p_access, "reading frontend event failed (%d) %s", |
|---|
| 300 | | i_ret, strerror(errno) ); |
|---|
| | 298 | msg_Err( p_access, "reading frontend event failed (%d): %m", |
|---|
| | 299 | i_ret ); |
|---|
| 301 | 300 | return; |
|---|
| 302 | 301 | } |
|---|
| … | … | |
| 380 | 379 | &p_frontend->info )) < 0 ) |
|---|
| 381 | 380 | { |
|---|
| 382 | | p += sprintf( p, "ioctl FE_GET_INFO failed (%d) %s\n", i_ret, |
|---|
| 383 | | strerror(errno) ); |
|---|
| | 381 | char buf[1000]; |
|---|
| | 382 | strerror_r( errno, buf, sizeof( buf ) ); |
|---|
| | 383 | p += sprintf( p, "ioctl FE_GET_INFO failed (%d) %s\n", i_ret, buf ); |
|---|
| 384 | 384 | goto out; |
|---|
| 385 | 385 | } |
|---|
| … | … | |
| 467 | 467 | < 0 ) |
|---|
| 468 | 468 | { |
|---|
| 469 | | p += sprintf( p, "</table>ioctl FE_READ_STATUS failed (%d) %s\n", i_ret, |
|---|
| 470 | | strerror(errno) ); |
|---|
| | 469 | char buf[1000]; |
|---|
| | 470 | strerror_r( errno, buf, sizeof( buf ) ); |
|---|
| | 471 | p += sprintf( p, "</table>ioctl FE_READ_STATUS failed (%d) %s\n", |
|---|
| | 472 | i_ret, buf ); |
|---|
| 471 | 473 | goto out; |
|---|
| 472 | 474 | } |
|---|
| … | … | |
| 524 | 526 | &p_frontend->info )) < 0 ) |
|---|
| 525 | 527 | { |
|---|
| 526 | | msg_Err( p_access, "ioctl FE_GET_INFO failed (%d) %s", i_ret, |
|---|
| 527 | | strerror(errno) ); |
|---|
| | 528 | msg_Err( p_access, "ioctl FE_GET_INFO failed (%d): %m", i_ret ); |
|---|
| 528 | 529 | return VLC_EGENERIC; |
|---|
| 529 | 530 | } |
|---|
| … | … | |
| 808 | 809 | if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_TONE, SEC_TONE_OFF )) < 0 ) |
|---|
| 809 | 810 | { |
|---|
| 810 | | msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %s", |
|---|
| 811 | | fe_tone == SEC_TONE_ON ? "on" : "off", i_err, |
|---|
| 812 | | strerror(errno) ); |
|---|
| | 811 | msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %m", |
|---|
| | 812 | fe_tone == SEC_TONE_ON ? "on" : "off", i_err ); |
|---|
| 813 | 813 | return i_err; |
|---|
| 814 | 814 | } |
|---|
| … | … | |
| 817 | 817 | if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_VOLTAGE, fe_voltage )) < 0 ) |
|---|
| 818 | 818 | { |
|---|
| 819 | | msg_Err( p_access, "ioctl FE_SET_VOLTAGE failed, voltage=%d (%d) %s", |
|---|
| 820 | | fe_voltage, i_err, strerror(errno) ); |
|---|
| | 819 | msg_Err( p_access, "ioctl FE_SET_VOLTAGE failed, voltage=%d (%d) %m", |
|---|
| | 820 | fe_voltage, i_err ); |
|---|
| 821 | 821 | return i_err; |
|---|
| 822 | 822 | } |
|---|
| … | … | |
| 827 | 827 | { |
|---|
| 828 | 828 | msg_Err( p_access, |
|---|
| 829 | | "ioctl FE_ENABLE_HIGH_LNB_VOLTAGE failed, val=%d (%d) %s", |
|---|
| 830 | | val.b_bool, i_err, strerror(errno) ); |
|---|
| | 829 | "ioctl FE_ENABLE_HIGH_LNB_VOLTAGE failed, val=%d (%d) %m", |
|---|
| | 830 | val.b_bool, i_err ); |
|---|
| 831 | 831 | } |
|---|
| 832 | 832 | |
|---|
| … | … | |
| 855 | 855 | &cmd.cmd )) < 0 ) |
|---|
| 856 | 856 | { |
|---|
| 857 | | msg_Err( p_access, "ioctl FE_SEND_MASTER_CMD failed (%d) %s", |
|---|
| 858 | | i_err, strerror(errno) ); |
|---|
| | 857 | msg_Err( p_access, "ioctl FE_SEND_MASTER_CMD failed (%d) %m", |
|---|
| | 858 | i_err ); |
|---|
| 859 | 859 | return i_err; |
|---|
| 860 | 860 | } |
|---|
| … | … | |
| 866 | 866 | ((val.i_int - 1) % 2) ? SEC_MINI_B : SEC_MINI_A )) < 0 ) |
|---|
| 867 | 867 | { |
|---|
| 868 | | msg_Err( p_access, "ioctl FE_SEND_BURST failed (%d) %s", |
|---|
| 869 | | i_err, strerror(errno) ); |
|---|
| | 868 | msg_Err( p_access, "ioctl FE_SEND_BURST failed (%d) %m", |
|---|
| | 869 | i_err ); |
|---|
| 870 | 870 | return i_err; |
|---|
| 871 | 871 | } |
|---|
| … | … | |
| 876 | 876 | if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_TONE, fe_tone )) < 0 ) |
|---|
| 877 | 877 | { |
|---|
| 878 | | msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %s", |
|---|
| 879 | | fe_tone == SEC_TONE_ON ? "on" : "off", i_err, |
|---|
| 880 | | strerror(errno) ); |
|---|
| | 878 | msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %m", |
|---|
| | 879 | fe_tone == SEC_TONE_ON ? "on" : "off", i_err ); |
|---|
| 881 | 880 | return i_err; |
|---|
| 882 | 881 | } |
|---|
| … | … | |
| 991 | 990 | if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) |
|---|
| 992 | 991 | { |
|---|
| 993 | | msg_Err( p_access, "DVB-S: setting frontend failed (%d) %s", i_ret, |
|---|
| 994 | | strerror(errno) ); |
|---|
| | 992 | msg_Err( p_access, "DVB-S: setting frontend failed (%d) %m", i_ret ); |
|---|
| 995 | 993 | return VLC_EGENERIC; |
|---|
| 996 | 994 | } |
|---|
| … | … | |
| 1036 | 1034 | if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) |
|---|
| 1037 | 1035 | { |
|---|
| 1038 | | msg_Err( p_access, "DVB-C: setting frontend failed (%d) %s", i_ret, |
|---|
| 1039 | | strerror(errno) ); |
|---|
| | 1036 | msg_Err( p_access, "DVB-C: setting frontend failed (%d): %m", i_ret ); |
|---|
| 1040 | 1037 | return VLC_EGENERIC; |
|---|
| 1041 | 1038 | } |
|---|
| … | … | |
| 1172 | 1169 | if( (ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) |
|---|
| 1173 | 1170 | { |
|---|
| 1174 | | msg_Err( p_access, "DVB-T: setting frontend failed (%d) %s", ret, |
|---|
| 1175 | | strerror(errno) ); |
|---|
| | 1171 | msg_Err( p_access, "DVB-T: setting frontend failed (%d): %s", ret ); |
|---|
| 1176 | 1172 | return -1; |
|---|
| 1177 | 1173 | } |
|---|
| … | … | |
| 1209 | 1205 | if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) |
|---|
| 1210 | 1206 | { |
|---|
| 1211 | | msg_Err( p_access, "ATSC: setting frontend failed (%d) %s", i_ret, |
|---|
| 1212 | | strerror(errno) ); |
|---|
| | 1207 | msg_Err( p_access, "ATSC: setting frontend failed (%d): %s", i_ret ); |
|---|
| 1213 | 1208 | return VLC_EGENERIC; |
|---|
| 1214 | 1209 | } |
|---|
| … | … | |
| 1248 | 1243 | if( (*pi_fd = open(dmx, O_RDWR)) < 0 ) |
|---|
| 1249 | 1244 | { |
|---|
| 1250 | | msg_Err( p_access, "DMXSetFilter: opening device failed (%s)", |
|---|
| 1251 | | strerror(errno) ); |
|---|
| | 1245 | msg_Err( p_access, "DMXSetFilter: opening device failed (%m)" ); |
|---|
| 1252 | 1246 | return VLC_EGENERIC; |
|---|
| 1253 | 1247 | } |
|---|
| … | … | |
| 1355 | 1349 | if( (i_ret = ioctl( *pi_fd, DMX_SET_PES_FILTER, &s_filter_params )) < 0 ) |
|---|
| 1356 | 1350 | { |
|---|
| 1357 | | msg_Err( p_access, "DMXSetFilter: failed with %d (%s)", i_ret, |
|---|
| 1358 | | strerror(errno) ); |
|---|
| | 1351 | msg_Err( p_access, "DMXSetFilter: failed with %d (%m)", i_ret ); |
|---|
| 1359 | 1352 | return VLC_EGENERIC; |
|---|
| 1360 | 1353 | } |
|---|
| … | … | |
| 1371 | 1364 | if( (i_ret = ioctl( i_fd, DMX_STOP )) < 0 ) |
|---|
| 1372 | 1365 | { |
|---|
| 1373 | | msg_Err( p_access, "DMX_STOP failed for demux (%d) %s", |
|---|
| 1374 | | i_ret, strerror(errno) ); |
|---|
| | 1366 | msg_Err( p_access, "DMX_STOP failed for demux (%d): %m", i_ret ); |
|---|
| 1375 | 1367 | return i_ret; |
|---|
| 1376 | 1368 | } |
|---|
| … | … | |
| 1411 | 1403 | if( (p_sys->i_handle = open(dvr, O_RDONLY)) < 0 ) |
|---|
| 1412 | 1404 | { |
|---|
| 1413 | | msg_Err( p_access, "DVROpen: opening device failed (%s)", |
|---|
| 1414 | | strerror(errno) ); |
|---|
| | 1405 | msg_Err( p_access, "DVROpen: opening device failed (%m)" ); |
|---|
| 1415 | 1406 | return VLC_EGENERIC; |
|---|
| 1416 | 1407 | } |
|---|
| … | … | |
| 1418 | 1409 | if( fcntl( p_sys->i_handle, F_SETFL, O_NONBLOCK ) == -1 ) |
|---|
| 1419 | 1410 | { |
|---|
| 1420 | | msg_Warn( p_access, "DVROpen: couldn't set non-blocking mode (%s)", |
|---|
| 1421 | | strerror(errno) ); |
|---|
| | 1411 | msg_Warn( p_access, "DVROpen: couldn't set non-blocking mode (%m)" ); |
|---|
| 1422 | 1412 | } |
|---|
| 1423 | 1413 | |
|---|
| … | … | |
| 1463 | 1453 | if( (p_sys->i_ca_handle = open(ca, O_RDWR | O_NONBLOCK)) < 0 ) |
|---|
| 1464 | 1454 | { |
|---|
| 1465 | | msg_Warn( p_access, "CAMInit: opening CAM device failed (%s)", |
|---|
| 1466 | | strerror(errno) ); |
|---|
| | 1455 | msg_Warn( p_access, "CAMInit: opening CAM device failed (%m)" ); |
|---|
| 1467 | 1456 | p_sys->i_ca_handle = 0; |
|---|
| 1468 | 1457 | return VLC_EGENERIC; |
|---|
| … | … | |
| 1687 | 1676 | if ( ioctl( p_sys->i_ca_handle, CA_GET_CAP, &caps ) != 0 ) |
|---|
| 1688 | 1677 | { |
|---|
| 1689 | | p += sprintf( p, "ioctl CA_GET_CAP failed (%s)\n", |
|---|
| 1690 | | strerror(errno) ); |
|---|
| | 1678 | char buf[1000]; |
|---|
| | 1679 | strerror_r( errno, buf, sizeof( buf ) ); |
|---|
| | 1680 | p += sprintf( p, "ioctl CA_GET_CAP failed (%s)\n", buf ); |
|---|
| 1691 | 1681 | goto out; |
|---|
| 1692 | 1682 | } |
|---|
| … | … | |
| 1729 | 1719 | if ( ioctl( p_sys->i_ca_handle, CA_GET_SLOT_INFO, &sinfo ) != 0 ) |
|---|
| 1730 | 1720 | { |
|---|
| 1731 | | p += sprintf( p, "ioctl CA_GET_SLOT_INFO failed (%s)<br>\n", |
|---|
| 1732 | | strerror(errno) ); |
|---|
| | 1721 | char buf[1000]; |
|---|
| | 1722 | strerror_r( errno, buf, sizeof( buf ) ); |
|---|
| | 1723 | p += sprintf( p, "ioctl CA_GET_SLOT_INFO failed (%s)<br>\n", buf ); |
|---|
| 1733 | 1724 | continue; |
|---|
| 1734 | 1725 | } |
|---|
| r6ee1e19 |
r552e595 |
|
| 169 | 169 | { |
|---|
| 170 | 170 | if (fstat (fd, &st)) |
|---|
| 171 | | msg_Err (p_access, "fstat(%d): %s", fd, strerror (errno)); |
|---|
| | 171 | msg_Err (p_access, "fstat(%d): %m", fd); |
|---|
| 172 | 172 | else |
|---|
| 173 | 173 | if (S_ISDIR (st.st_mode)) |
|---|
| … | … | |
| 278 | 278 | |
|---|
| 279 | 279 | default: |
|---|
| 280 | | msg_Err (p_access, "read failed (%s)", strerror (errno)); |
|---|
| | 280 | msg_Err (p_access, "read failed (%m)"); |
|---|
| | 281 | /* FIXME: DO NOT USE strerror!!!! */ |
|---|
| 281 | 282 | intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"), |
|---|
| 282 | 283 | _("VLC could not read file \"%s\"."), |
|---|
| … | … | |
| 446 | 447 | if (fd == -1) |
|---|
| 447 | 448 | { |
|---|
| 448 | | msg_Err (p_access, "cannot open file %s (%s)", psz_name, |
|---|
| 449 | | strerror (errno)); |
|---|
| | 449 | msg_Err (p_access, "cannot open file %s (%m)", psz_name); |
|---|
| 450 | 450 | intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"), |
|---|
| 451 | 451 | _("VLC could not open file \"%s\" (%s)."), |
|---|
| r8917f56 |
r552e595 |
|
| 1043 | 1043 | if( i_ret < 0 ) |
|---|
| 1044 | 1044 | { |
|---|
| 1045 | | msg_Err( p_access, "network select error (%s)", strerror(errno) ); |
|---|
| | 1045 | msg_Err( p_access, "network select error (%m)" ); |
|---|
| 1046 | 1046 | return -1; |
|---|
| 1047 | 1047 | } |
|---|
| r81c5ac2 |
r552e595 |
|
| 832 | 832 | if( p_sys->i_fd < 0 ) |
|---|
| 833 | 833 | { |
|---|
| 834 | | msg_Err( p_access, "Cannot open device (%s).", strerror( errno ) ); |
|---|
| | 834 | msg_Err( p_access, "Cannot open device (%m)." ); |
|---|
| 835 | 835 | Close( VLC_OBJECT(p_access) ); |
|---|
| 836 | 836 | return VLC_EGENERIC; |
|---|
| … | … | |
| 937 | 937 | if( p_sys->i_radio_fd < 0 ) |
|---|
| 938 | 938 | { |
|---|
| 939 | | msg_Err( p_access, "Cannot open radio device (%s).", |
|---|
| 940 | | strerror( errno ) ); |
|---|
| | 939 | msg_Err( p_access, "Cannot open radio device (%m)." ); |
|---|
| 941 | 940 | Close( VLC_OBJECT(p_access) ); |
|---|
| 942 | 941 | return VLC_EGENERIC; |
|---|
| … | … | |
| 955 | 954 | if ( result < 0 ) |
|---|
| 956 | 955 | { |
|---|
| 957 | | msg_Warn( p_access, "Failed to read tuner information (%s).", |
|---|
| 958 | | strerror( errno ) ); |
|---|
| | 956 | msg_Warn( p_access, "Failed to read tuner information (%m)." ); |
|---|
| 959 | 957 | } |
|---|
| 960 | 958 | else |
|---|
| … | … | |
| 968 | 966 | if ( result < 0 ) |
|---|
| 969 | 967 | { |
|---|
| 970 | | msg_Warn( p_access, "Failed to read tuner frequency (%s).", |
|---|
| 971 | | strerror( errno ) ); |
|---|
| | 968 | msg_Warn( p_access, "Failed to read tuner frequency (%m)." ); |
|---|
| 972 | 969 | } |
|---|
| 973 | 970 | else |
|---|
| … | … | |
| 981 | 978 | if( result < 0 ) |
|---|
| 982 | 979 | { |
|---|
| 983 | | msg_Warn( p_access, "Failed to set tuner frequency (%s).", |
|---|
| 984 | | strerror( errno ) ); |
|---|
| | 980 | msg_Warn( p_access, "Failed to set tuner frequency (%m)." ); |
|---|
| 985 | 981 | } |
|---|
| 986 | 982 | else |
|---|
| … | … | |
| 1091 | 1087 | if( i_ret < 0 ) |
|---|
| 1092 | 1088 | { |
|---|
| 1093 | | msg_Err( p_access, "Select error (%s).", strerror( errno ) ); |
|---|
| | 1089 | msg_Err( p_access, "Polling error (%m)." ); |
|---|
| 1094 | 1090 | return -1; |
|---|
| 1095 | 1091 | } |
|---|
| r6ee1e19 |
r552e595 |
|
| 221 | 221 | if( !smbc_init_context( p_smb ) ) |
|---|
| 222 | 222 | { |
|---|
| 223 | | msg_Err( p_access, "cannot initialize context (%s)", strerror(errno) ); |
|---|
| | 223 | msg_Err( p_access, "cannot initialize context (%m)" ); |
|---|
| 224 | 224 | smbc_free_context( p_smb, 1 ); |
|---|
| 225 | 225 | free( psz_uri ); |
|---|
| … | … | |
| 229 | 229 | if( !(p_file = (p_smb->open)( p_smb, psz_uri, O_RDONLY, 0 )) ) |
|---|
| 230 | 230 | { |
|---|
| 231 | | msg_Err( p_access, "open failed for '%s' (%s)", |
|---|
| 232 | | p_access->psz_path, strerror(errno) ); |
|---|
| | 231 | msg_Err( p_access, "open failed for '%s' (%m)", |
|---|
| | 232 | p_access->psz_path ); |
|---|
| 233 | 233 | smbc_free_context( p_smb, 1 ); |
|---|
| 234 | 234 | free( psz_uri ); |
|---|
| … | … | |
| 240 | 240 | |
|---|
| 241 | 241 | i_ret = p_smb->fstat( p_smb, p_file, &filestat ); |
|---|
| 242 | | if( i_ret ) msg_Err( p_access, "stat failed (%s)", strerror(errno) ); |
|---|
| | 242 | if( i_ret ) msg_Err( p_access, "stat failed (%m)" ); |
|---|
| 243 | 243 | else p_access->info.i_size = filestat.st_size; |
|---|
| 244 | 244 | #else |
|---|
| … | … | |
| 262 | 262 | if( (i_smb = smbc_open( psz_uri, O_RDONLY, 0 )) < 0 ) |
|---|
| 263 | 263 | { |
|---|
| 264 | | msg_Err( p_access, "open failed for '%s' (%s)", |
|---|
| 265 | | p_access->psz_path, strerror(errno) ); |
|---|
| | 264 | msg_Err( p_access, "open failed for '%s' (%m)", |
|---|
| | 265 | p_access->psz_path ); |
|---|
| 266 | 266 | free( psz_uri ); |
|---|
| 267 | 267 | return VLC_EGENERIC; |
|---|
| … | … | |
| 272 | 272 | |
|---|
| 273 | 273 | i_ret = smbc_fstat( i_smb, &filestat ); |
|---|
| 274 | | if( i_ret ) msg_Err( p_access, "stat failed (%s)", strerror(i_ret) ); |
|---|
| | 274 | if( i_ret ) |
|---|
| | 275 | { |
|---|
| | 276 | errno = i_ret; |
|---|
| | 277 | msg_Err( p_access, "stat failed (%m)" ); |
|---|
| | 278 | } |
|---|
| 275 | 279 | else p_access->info.i_size = filestat.st_size; |
|---|
| 276 | 280 | #endif |
|---|
| … | … | |
| 332 | 336 | if( i_ret == -1 ) |
|---|
| 333 | 337 | { |
|---|
| 334 | | msg_Err( p_access, "seek failed (%s)", strerror(errno) ); |
|---|
| | 338 | msg_Err( p_access, "seek failed (%m)" ); |
|---|
| 335 | 339 | return VLC_EGENERIC; |
|---|
| 336 | 340 | } |
|---|
| … | … | |
| 359 | 363 | if( i_read < 0 ) |
|---|
| 360 | 364 | { |
|---|
| 361 | | msg_Err( p_access, "read failed (%s)", strerror(errno) ); |
|---|
| | 365 | msg_Err( p_access, "read failed (%m)" ); |
|---|
| 362 | 366 | return -1; |
|---|
| 363 | 367 | } |
|---|
| r6ee1e19 |
r552e595 |
|
| 879 | 879 | if( ( i_fd = open( psz_device, O_RDWR ) ) < 0 ) |
|---|
| 880 | 880 | { |
|---|
| 881 | | msg_Err( p_demux, "cannot open device (%s)", strerror( errno ) ); |
|---|
| | 881 | msg_Err( p_demux, "cannot open device (%m)" ); |
|---|
| 882 | 882 | goto vdev_failed; |
|---|
| 883 | 883 | } |
|---|
| … | … | |
| 885 | 885 | if( ioctl( i_fd, VIDIOCGCAP, &p_sys->vid_cap ) < 0 ) |
|---|
| 886 | 886 | { |
|---|
| 887 | | msg_Err( p_demux, "cannot get capabilities (%s)", strerror( errno ) ); |
|---|
| | 887 | msg_Err( p_demux, "cannot get capabilities (%m)" ); |
|---|
| 888 | 888 | goto vdev_failed; |
|---|
| 889 | 889 | } |
|---|
| … | … | |
| 930 | 930 | if( ioctl( i_fd, VIDIOCGCHAN, &vid_channel ) < 0 ) |
|---|
| 931 | 931 | { |
|---|
| 932 | | msg_Err( p_demux, "cannot get channel infos (%s)", |
|---|
| 933 | | strerror( errno ) ); |
|---|
| | 932 | msg_Err( p_demux, "cannot get channel infos (%m)" ); |
|---|
| 934 | 933 | goto vdev_failed; |
|---|
| 935 | 934 | } |
|---|
| … | … | |
| 948 | 947 | if( ioctl( i_fd, VIDIOCSCHAN, &vid_channel ) < 0 ) |
|---|
| 949 | 948 | { |
|---|
| 950 | | msg_Err( p_demux, "cannot set channel (%s)", strerror( errno ) ); |
|---|
| | 949 | msg_Err( p_demux, "cannot set channel (%m)" ); |
|---|
| 951 | 950 | goto vdev_failed; |
|---|
| 952 | 951 | } |
|---|
| … | … | |
| 963 | 962 | if( ioctl( i_fd, VIDIOCGTUNER, &vid_tuner ) < 0 ) |
|---|
| 964 | 963 | { |
|---|
| 965 | | msg_Err( p_demux, "cannot get tuner (%s)", strerror( errno ) ); |
|---|
| | 964 | msg_Err( p_demux, "cannot get tuner (%m)" ); |
|---|
| 966 | 965 | goto vdev_failed; |
|---|
| 967 | 966 | } |
|---|
| … | … | |
| 978 | 977 | if( ioctl( i_fd, VIDIOCSTUNER, &vid_tuner ) < 0 ) |
|---|
| 979 | 978 | { |
|---|
| 980 | | msg_Err( p_demux, "cannot set tuner (%s)", strerror( errno ) ); |
|---|
| | 979 | msg_Err( p_demux, "cannot set tuner (%m)" ); |
|---|
| 981 | 980 | goto vdev_failed; |
|---|
| 982 | 981 | } |
|---|
| … | … | |
| 994 | 993 | if( ioctl( i_fd, VIDIOCSFREQ, &driver_frequency ) < 0 ) |
|---|
| 995 | 994 | { |
|---|
| 996 | | msg_Err( p_demux, "cannot set frequency (%s)", |
|---|
| 997 | | strerror( errno ) ); |
|---|
| | 995 | msg_Err( p_demux, "cannot set frequency (%m)" ); |
|---|
| 998 | 996 | goto vdev_failed; |
|---|
| 999 | 997 | } |
|---|
| … | … | |
| 1014 | 1012 | if( ioctl( i_fd, VIDIOCGAUDIO, &vid_audio ) < 0 ) |
|---|
| 1015 | 1013 | { |
|---|
| 1016 | | msg_Err( p_demux, "cannot get audio (%s)", strerror( errno ) ); |
|---|
| | 1014 | msg_Err( p_demux, "cannot get audio (%m)" ); |
|---|
| 1017 | 1015 | goto vdev_failed; |
|---|
| 1018 | 1016 | } |
|---|
| … | … | |
| 1023 | 1021 | if( ioctl( i_fd, VIDIOCSAUDIO, &vid_audio ) < 0 ) |
|---|
| 1024 | 1022 | { |
|---|
| 1025 | | msg_Err( p_demux, "cannot set audio (%s)", strerror( errno ) ); |
|---|
| | 1023 | msg_Err( p_demux, "cannot set audio (%m)" ); |
|---|
| 1026 | 1024 | goto vdev_failed; |
|---|
| 1027 | 1025 | } |
|---|
| … | … | |
| 1039 | 1037 | if( ioctl( i_fd, MJPIOC_G_PARAMS, &mjpeg ) < 0 ) |
|---|
| 1040 | 1038 | { |
|---|
| 1041 | | msg_Err( p_demux, "cannot get mjpeg params (%s)", |
|---|
| 1042 | | strerror( errno ) ); |
|---|
| | 1039 | msg_Err( p_demux, "cannot get mjpeg params (%m)" ); |
|---|
| 1043 | 1040 | goto vdev_failed; |
|---|
| 1044 | 1041 | } |
|---|
| … | … | |
| 1090 | 1087 | if( ioctl( i_fd, MJPIOC_S_PARAMS, &mjpeg ) < 0 ) |
|---|
| 1091 | 1088 | { |
|---|
| 1092 | | msg_Err( p_demux, "cannot set mjpeg params (%s)", |
|---|
| 1093 | | strerror( errno ) ); |
|---|
| | 1089 | msg_Err( p_demux, "cannot set mjpeg params (%m)" ); |
|---|
| 1094 | 1090 | goto vdev_failed; |
|---|
| 1095 | 1091 | } |
|---|
| … | … | |
| 1107 | 1103 | if( ioctl( i_fd, VIDIOCGWIN, &vid_win ) < 0 ) |
|---|
| 1108 | 1104 | { |
|---|
| 1109 | | msg_Err( p_demux, "cannot get win (%s)", strerror( errno ) ); |
|---|
| | 1105 | msg_Err( p_demux, "cannot get win (%m)" ); |
|---|
| 1110 | 1106 | goto vdev_failed; |
|---|
| 1111 | 1107 | } |
|---|
| … | … | |
| 1337 | 1333 | if( (i_fd = open( psz_device, O_RDONLY | O_NONBLOCK )) < 0 ) |
|---|
| 1338 | 1334 | { |
|---|
| 1339 | | msg_Err( p_demux, "cannot open audio device (%s)", strerror( errno ) ); |
|---|
| | 1335 | msg_Err( p_demux, "cannot open audio device (%m)" ); |
|---|
| 1340 | 1336 | goto adev_fail; |
|---|
| 1341 | 1337 | } |
|---|
| … | … | |
| 1346 | 1342 | { |
|---|
| 1347 | 1343 | msg_Err( p_demux, "cannot set audio format (16b little endian) " |
|---|
| 1348 | | "(%s)", strerror( errno ) ); |
|---|
| | 1344 | "(%m)" ); |
|---|
| 1349 | 1345 | goto adev_fail; |
|---|
| 1350 | 1346 | } |
|---|
| … | … | |
| 1353 | 1349 | &p_sys->b_stereo ) < 0 ) |
|---|
| 1354 | 1350 | { |
|---|
| 1355 | | msg_Err( p_demux, "cannot set audio channels count (%s)", |
|---|
| 1356 | | strerror( errno ) ); |
|---|
| | 1351 | msg_Err( p_demux, "cannot set audio channels count (%m)" ); |
|---|
| 1357 | 1352 | goto adev_fail; |
|---|
| 1358 | 1353 | } |
|---|
| … | … | |
| 1361 | 1356 | &p_sys->i_sample_rate ) < 0 ) |
|---|
| 1362 | 1357 | { |
|---|
| 1363 | | msg_Err( p_demux, "cannot set audio sample rate (%s)", |
|---|
| 1364 | | strerror( errno ) ); |
|---|
| | 1358 | msg_Err( p_demux, "cannot set audio sample rate (%m)" ); |
|---|
| 1365 | 1359 | goto adev_fail; |
|---|
| 1366 | 1360 | } |
|---|
| r6ee1e19 |
r552e595 |
|
| 189 | 189 | if( ( i_fd = open( p_sys->psz_device, O_RDWR ) ) < 0 ) |
|---|
| 190 | 190 | { |
|---|
| 191 | | msg_Err( p_demux, "cannot open device (%s)", strerror( errno ) ); |
|---|
| | 191 | msg_Err( p_demux, "cannot open device (%m)" ); |
|---|
| 192 | 192 | goto open_failed; |
|---|
| 193 | 193 | } |
|---|
| … | … | |
| 204 | 204 | if( ioctl( i_fd, VIDIOC_S_INPUT, &p_sys->i_selected_input ) < 0 ) |
|---|
| 205 | 205 | { |
|---|
| 206 | | msg_Err( p_demux, "cannot set input (%s)", strerror( errno ) ); |
|---|
| | 206 | msg_Err( p_demux, "cannot set input (%m)" ); |
|---|
| 207 | 207 | goto open_failed; |
|---|
| 208 | 208 | } |
|---|
| … | … | |
| 218 | 218 | if( ioctl( i_fd, VIDIOC_REQBUFS, &reqbuf ) < 0 ) |
|---|
| 219 | 219 | { |
|---|
| 220 | | msg_Err( p_demux, "cannot initiate I/O operation (%s). " |
|---|
| 221 | | "Only MMAP is supported at the moment", strerror( errno ) ); |
|---|
| | 220 | msg_Err( p_demux, "cannot initiate I/O operation (%m). " |
|---|
| | 221 | "Only MMAP is supported at the moment" ); |
|---|
| 222 | 222 | goto open_failed; |
|---|
| 223 | 223 | } |
|---|
| … | … | |
| 251 | 251 | if( ( i_fd = open( p_sys->psz_device, O_RDWR ) ) < 0 ) |
|---|
| 252 | 252 | { |
|---|
| 253 | | msg_Err( p_demux, "cannot open device (%s)", strerror( errno ) ); |
|---|
| | 253 | msg_Err( p_demux, "cannot open device (%m)" ); |
|---|
| 254 | 254 | goto open_failed; |
|---|
| 255 | 255 | } |
|---|
| … | … | |
| 259 | 259 | if( ioctl( i_fd, VIDIOC_QUERYCAP, &p_sys->dev_cap ) < 0 ) |
|---|
| 260 | 260 | { |
|---|
| 261 | | msg_Err( p_demux, "cannot get capabilities (%s)", strerror( errno ) ); |
|---|
| | 261 | msg_Err( p_demux, "cannot get capabilities (%m)" ); |
|---|
| 262 | 262 | goto open_failed; |
|---|
| 263 | 263 | } |
|---|
| … | … | |
| 306 | 306 | if( ioctl( i_fd, VIDIOC_ENUMINPUT, &p_sys->p_inputs[i_index] ) ) |
|---|
| 307 | 307 | { |
|---|
| 308 | | msg_Err( p_demux, "cannot get video input characteristics (%s)", |
|---|
| 309 | | strerror( errno ) ); |
|---|
| | 308 | msg_Err( p_demux, |
|---|
| | 309 | "cannot get video input characteristics (%m)" ); |
|---|
| 310 | 310 | goto open_failed; |
|---|
| 311 | 311 | } |
|---|
| … | … | |
| 335 | 335 | if( ioctl( i_fd, VIDIOC_G_AUDIO, &p_sys->p_audios[ p_sys->i_audio] ) < 0 ) |
|---|
| 336 | 336 | { |
|---|
| 337 | | msg_Err( p_demux, "cannot get video input characteristics (%s)", |
|---|
| 338 | | strerror( errno ) ); |
|---|
| | 337 | msg_Err( p_demux, |
|---|
| | 338 | "cannot get video input characteristics (%m)" ); |
|---|
| 339 | 339 | goto open_failed; |
|---|
| 340 | 340 | } |
|---|
| … | … | |
| 372 | 372 | if( ioctl( i_fd, VIDIOC_G_TUNER, &p_sys->p_tuners[i_index] ) ) |
|---|
| 373 | 373 | { |
|---|
| 374 | | msg_Err( p_demux, "cannot get tuner characteristics (%s)", |
|---|
| 375 | | strerror( errno ) ); |
|---|
| | 374 | msg_Err( p_demux, "cannot get tuner characteristics (%m)" ); |
|---|
| 376 | 375 | goto open_failed; |
|---|
| 377 | 376 | } |
|---|
| … | … | |
| 422 | 421 | if( ioctl( i_fd, VIDIOC_ENUM_FMT, &p_sys->p_codecs[i_index] ) < 0 ) |
|---|
| 423 | 422 | { |
|---|
| 424 | | msg_Err( p_demux, "cannot get codec description (%s)", strerror( errno ) ); |
|---|
| | 423 | msg_Err( p_demux, "cannot get codec description (%m)" ); |
|---|
| 425 | 424 | goto open_failed; |
|---|
| 426 | 425 | } |
|---|
| r9e595c9 |
r552e595 |
|
| 112 | 112 | if ((p_sys->stream = tmpfile ()) == NULL) |
|---|
| 113 | 113 | { |
|---|
| 114 | | msg_Err (access, "cannot create temporary file: %s", strerror (errno)); |
|---|
| | 114 | msg_Err (access, "cannot create temporary file: %m"); |
|---|
| 115 | 115 | free (p_sys); |
|---|
| 116 | 116 | return VLC_EGENERIC; |
|---|
| … | … | |
| 168 | 168 | if (fwrite (buffer, len, 1, stream) != 1) |
|---|
| 169 | 169 | { |
|---|
| 170 | | msg_Err (access, "cannot write to file: %s", strerror (errno)); |
|---|
| | 170 | msg_Err (access, "cannot write to file: %m"); |
|---|
| 171 | 171 | goto error; |
|---|
| 172 | 172 | } |
|---|
| … | … | |
| 295 | 295 | if (newstream == NULL) |
|---|
| 296 | 296 | { |
|---|
| 297 | | msg_Err (access, "cannot create dump file \"%s\": %s", filename, |
|---|
| 298 | | strerror (errno)); |
|---|
| | 297 | msg_Err (access, "cannot create dump file \"%s\": %m", filename); |
|---|
| 299 | 298 | return; |
|---|
| 300 | 299 | } |
|---|
| … | … | |
| 312 | 311 | if (ferror (oldstream)) |
|---|
| 313 | 312 | { |
|---|
| 314 | | msg_Err (access, "cannot read temporary file: %s", |
|---|
| 315 | | strerror (errno)); |
|---|
| | 313 | msg_Err (access, "cannot read temporary file: %m"); |
|---|
| 316 | 314 | break; |
|---|
| 317 | 315 | } |
|---|
| … | … | |
| 326 | 324 | if (fwrite (buf, len, 1, newstream) != 1) |
|---|
| 327 | 325 | { |
|---|
| 328 | | msg_Err (access, "cannot write dump file: %s", strerror (errno)); |
|---|
| | 326 | msg_Err (access, "cannot write dump file: %m"); |
|---|
| 329 | 327 | break; |
|---|
| 330 | 328 | } |
|---|
| r16f32e1 |
r552e595 |
|
| 448 | 448 | if( p_sys->f == NULL ) |
|---|
| 449 | 449 | { |
|---|
| 450 | | msg_Err( p_access, "cannot open file '%s' (%s)", |
|---|
| 451 | | p_sys->psz_file, strerror(errno) ); |
|---|
| | 450 | msg_Err( p_access, "cannot open file '%s' (%m)", |
|---|
| | 451 | p_sys->psz_file ); |
|---|
| 452 | 452 | free( p_sys->psz_file ); |
|---|
| 453 | 453 | p_sys->psz_file = NULL; |
|---|
| r00aa3ff |
r552e595 |
|
| 423 | 423 | { |
|---|
| 424 | 424 | /* We just can't work with less than 2 buffer files */ |
|---|
| 425 | | msg_Err( p_access, "cannot open temporary file '%s' (%s)", |
|---|
| 426 | | p_sys->psz_filename, strerror(errno) ); |
|---|
| | 425 | msg_Err( p_access, "cannot open temporary file '%s' (%m)", |
|---|
| | 426 | p_sys->psz_filename ); |
|---|
| 427 | 427 | return VLC_EGENERIC; |
|---|
| 428 | 428 | } |
|---|
| re40d134 |
r552e595 |
|
| 139 | 139 | if( fd == -1 ) |
|---|
| 140 | 140 | { |
|---|
| 141 | | msg_Err( p_access, "cannot open `%s' (%s)", p_access->psz_path, |
|---|
| 142 | | strerror( errno ) ); |
|---|
| | 141 | msg_Err( p_access, "cannot open `%s' (%m)", p_access->psz_path ); |
|---|
| 143 | 142 | free( p_access->p_sys ); |
|---|
| 144 | 143 | return( VLC_EGENERIC ); |
|---|
| rd568542 |
r552e595 |
|
| 466 | 466 | mtime_t i_to_send = p_thread->i_group; |
|---|
| 467 | 467 | int i_dropped_packets = 0; |
|---|
| 468 | | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| 469 | | char strerror_buf[WINSOCK_STRERROR_SIZE]; |
|---|
| 470 | | # define strerror( x ) winsock_strerror( strerror_buf ) |
|---|
| 471 | | #endif |
|---|
| 472 | 468 | |
|---|
| 473 | 469 | while( !p_thread->b_die ) |
|---|
| … | … | |
| 524 | 520 | if (val == -1) |
|---|
| 525 | 521 | { |
|---|