From cc7e6879786102a1075ac4a51ee714777a8166df Mon Sep 17 00:00:00 2001 From: Pierre Veyre Date: Tue, 1 Apr 2014 11:08:39 +0200 Subject: [PATCH] Change MSG_file_unlink() return type --- include/msg/msg.h | 2 +- src/msg/msg_io.c | 2 +- src/surf/workstation_interface.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/msg/msg.h b/include/msg/msg.h index 04e23b2f3f..880010040d 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -89,7 +89,7 @@ XBT_PUBLIC(msg_error_t) MSG_file_set_data(msg_file_t fd, void * data); XBT_PUBLIC(int) MSG_file_close(msg_file_t fd); XBT_PUBLIC(sg_size_t) MSG_file_get_size(msg_file_t fd); XBT_PUBLIC(void) MSG_file_dump(msg_file_t fd); -XBT_PUBLIC(int) MSG_file_unlink(msg_file_t fd); +XBT_PUBLIC(msg_error_t) MSG_file_unlink(msg_file_t fd); XBT_PUBLIC(msg_error_t) MSG_file_seek(msg_file_t fd, sg_size_t offset, int origin); XBT_PUBLIC(sg_size_t) MSG_file_tell (msg_file_t fd); XBT_PUBLIC(void) __MSG_file_get_info(msg_file_t fd); diff --git a/src/msg/msg_io.c b/src/msg/msg_io.c index 5ab29a3a23..c48fa55d33 100644 --- a/src/msg/msg_io.c +++ b/src/msg/msg_io.c @@ -228,7 +228,7 @@ int MSG_file_close(msg_file_t fd) * \param fd is the file descriptor (#msg_file_t) * \return 0 on success or 1 on error */ -int MSG_file_unlink(msg_file_t fd) +msg_error_t MSG_file_unlink(msg_file_t fd) { msg_file_priv_t priv = MSG_file_priv(fd); int res = simcall_file_unlink(priv->simdata->smx_file); diff --git a/src/surf/workstation_interface.cpp b/src/surf/workstation_interface.cpp index cc7fb44fcd..5f44530010 100644 --- a/src/surf/workstation_interface.cpp +++ b/src/surf/workstation_interface.cpp @@ -268,7 +268,7 @@ ActionPtr Workstation::write(surf_file_t fd, sg_size_t size) { int Workstation::unlink(surf_file_t fd) { if (!fd){ XBT_WARN("No such file descriptor. Impossible to unlink"); - return 0; + return MSG_TASK_CANCELED; } else { StoragePtr st = findStorageOnMountList(fd->mount); @@ -276,7 +276,7 @@ int Workstation::unlink(surf_file_t fd) { if (!xbt_dict_get_or_null(st->p_content, fd->name)){ XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name, st->getName()); - return 0; + return MSG_TASK_CANCELED; } else { XBT_DEBUG("UNLINK on disk '%s'",st->getName()); st->m_usedSize -= fd->size; @@ -287,7 +287,7 @@ int Workstation::unlink(surf_file_t fd) { free(fd->name); free(fd->mount); xbt_free(fd); - return 1; + return MSG_OK; } } } -- 2.20.1