Ticket #1102: FileNotFound_to_CantOpenFile.patch

File FileNotFound_to_CantOpenFile.patch, 646 bytes (added by altsysrq@…, 18 years ago)

Improved error message displaying for cases when file can't be opened.

  • stream/stream_file.c

     
    66#include <sys/stat.h>
    77#include <fcntl.h>
    88#include <unistd.h>
     9#include <string.h>
     10#include <errno.h>
    911
    1012#include "mp_msg.h"
    1113#include "stream.h"
     
    145147#endif
    146148      f=open(filename,m, openmode);
    147149    if(f<0) {
    148       mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);
     150      mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenFileError,filename,strerror(errno));
    149151      m_struct_free(&stream_opts,opts);
    150152      return STREAM_ERROR;
    151153    }