forked from enlightenment/enlightenment
uuid: Check error on ftruncate call
Summary: Fixes warning: src/bin/e_uuid_store.c:71:4: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result] ftruncate(store->shmfd, TABLE_SIZE); ^ Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2156
This commit is contained in:
parent
0ddedd09a4
commit
f4cb6a398b
|
@ -44,6 +44,11 @@ e_uuid_dump(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the UUID store
|
||||||
|
*
|
||||||
|
* @returns 1 if init was successful, 0 on failure
|
||||||
|
*/
|
||||||
EINTERN int
|
EINTERN int
|
||||||
e_uuid_store_init(void)
|
e_uuid_store_init(void)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +73,11 @@ e_uuid_store_init(void)
|
||||||
|
|
||||||
/* Adjust in memory blob to our given table size */
|
/* Adjust in memory blob to our given table size */
|
||||||
/* FIXME: How can we make sure we have the right size for our given table? */
|
/* FIXME: How can we make sure we have the right size for our given table? */
|
||||||
ftruncate(store->shmfd, TABLE_SIZE);
|
if (ftruncate(store->shmfd, TABLE_SIZE) < 0)
|
||||||
|
{
|
||||||
|
ERR("ftruncate failed: %s", strerror(errno));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
store->table = (struct uuid_table *)mmap(NULL, TABLE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, store->shmfd, 0);
|
store->table = (struct uuid_table *)mmap(NULL, TABLE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, store->shmfd, 0);
|
||||||
if (store->table == NULL)
|
if (store->table == NULL)
|
||||||
|
|
Loading…
Reference in New Issue