diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-02-19 06:42:08 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-02-19 06:42:08 +0000 |
commit | 225a939a00490c2e6f45cd068abd514c96dde50e (patch) | |
tree | c71d80f55612681cbd7462c39e1dafd1400960b1 /recordmydesktop/src | |
parent | 11933acc03f1145fa775eee7a7a83f258cfe13fe (diff) |
added check so program will exit before the attach, when it fails to obtain the shared memory
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@284 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r-- | recordmydesktop/src/initialize_data.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/recordmydesktop/src/initialize_data.c b/recordmydesktop/src/initialize_data.c index c65fcf1..8223f19 100644 --- a/recordmydesktop/src/initialize_data.c +++ b/recordmydesktop/src/initialize_data.c @@ -121,10 +121,14 @@ int InitializeData(ProgData *pdata, &pdata->shminfo, pdata->brwin.rgeom.width, pdata->brwin.rgeom.height); - pdata->shminfo.shmid=shmget (IPC_PRIVATE, - pdata->shimage->bytes_per_line* - pdata->shimage->height, - IPC_CREAT|0777); + pdata->shminfo.shmid=shmget(IPC_PRIVATE, + pdata->shimage->bytes_per_line* + pdata->shimage->height, + IPC_CREAT|0777); + if(shminfo->shmid==-1){ + fprintf(stderr,"Failed to obtain Shared Memory segment!\n"); + return 12; + } pdata->shminfo.shmaddr=pdata->shimage->data=shmat(pdata->shminfo.shmid, NULL,0); pdata->shminfo.readOnly = False; |