* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_get_value_float (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
+GNUNET_CONFIGURATION_get_value_float (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
const char *option,
float *number);
size_t buf_size);
-
-
-
/**
* Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR"
* where either in the "PATHS" section or the environtment "FOO" is
BY_HANDLE_FILE_INFORMATION info;
int succ;
- fh = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READ, 0);
- if (fh == NULL)
+ fh = GNUNET_DISK_file_open (filename,
+ GNUNET_DISK_OPEN_READ,
+ GNUNET_DISK_PERM_NONE);
+ if (NULL == fh)
return GNUNET_SYSERR;
succ = GetFileInformationByHandle (fh->h, &info);
GNUNET_DISK_file_close (fh);
fh = GNUNET_DISK_file_open (fn,
GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_TRUNCATE
| GNUNET_DISK_OPEN_CREATE, mode);
- if (!fh)
+ if (! fh)
return GNUNET_SYSERR;
ret = GNUNET_DISK_file_write (fh, buffer, n);
GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh));
/**
- * Close an open file
+ * Close an open file.
+ *
* @param h file handle
- * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
*/
int
GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h)
ret = GNUNET_OK;
#if MINGW
- if (!CloseHandle (h->h))
+ if (! CloseHandle (h->h))
{
SetErrnoFromWinError (GetLastError ());
LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "close");
}
if (h->oOverlapRead)
{
- if (!CloseHandle (h->oOverlapRead->hEvent))
+ if (! CloseHandle (h->oOverlapRead->hEvent))
{
SetErrnoFromWinError (GetLastError ());
LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "close");
GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh)
{
struct GNUNET_DISK_FileHandle *fh;
-
DWORD dwret;
enum GNUNET_FILE_Type ftype;
ftype = GNUNET_DISK_HANLDE_TYPE_PIPE;
break;
case FILE_TYPE_UNKNOWN:
- if (GetLastError () == NO_ERROR || GetLastError () == ERROR_INVALID_HANDLE)
+ if ( (GetLastError () == NO_ERROR) ||
+ (GetLastError () == ERROR_INVALID_HANDLE) )
{
if (0 != ResetEvent (osfh))
ftype = GNUNET_DISK_HANLDE_TYPE_EVENT;