diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-10-01 15:46:08 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-10-01 15:46:08 +0000 |
commit | 44abbcfbb8544322fe9e6d1b464cb138b2b485fc (patch) | |
tree | b2ffc005ba6edea4a728c7253faf9c5f39198fc2 | |
parent | 3f59d16c0a87c2dee1baf754ac6348c260436f12 (diff) |
check if file was opened succesfully
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@81 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r-- | recordmydesktop/doc/recordmydesktop.1 | 2 | ||||
-rw-r--r-- | recordmydesktop/src/init_encoder.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/recordmydesktop/doc/recordmydesktop.1 b/recordmydesktop/doc/recordmydesktop.1 index 12061e2..e8cbb6a 100644 --- a/recordmydesktop/doc/recordmydesktop.1 +++ b/recordmydesktop/doc/recordmydesktop.1 @@ -139,6 +139,8 @@ The following error codes indicate the nature of the error: .br 12 Cannot attach shared memory to proccess. .br +13 Cannot open file for writting. +.br .br .SH OPTIONS .PP diff --git a/recordmydesktop/src/init_encoder.c b/recordmydesktop/src/init_encoder.c index 1ca9ed4..ed1ad53 100644 --- a/recordmydesktop/src/init_encoder.c +++ b/recordmydesktop/src/init_encoder.c @@ -40,8 +40,10 @@ void InitEncoder(ProgData *pdata,EncData *enc_data_t){ ogg_stream_init(&(enc_data_t)->m_ogg_vs,y2); (enc_data_t)->fp=fopen((pdata)->args.filename,"w"); - - + if((enc_data_t)->fp==NULL){ + fprintf(stderr,"Cannot open file %s for writting!\n",(pdata)->args.filename); + exit(13); + } theora_info_init(&(enc_data_t)->m_th_inf); (enc_data_t)->m_th_inf.frame_width=(pdata)->brwin.rgeom.width; (enc_data_t)->m_th_inf.frame_height=(pdata)->brwin.rgeom.height; |