*/
const char *
-FileIO_ErrorEnglish(FileIOResult status) // IN
+FileIO_ErrorEnglish(FileIOResult status) // IN:
{
return Msg_StripMSGID(FileIO_MsgError(status));
}
*/
const char *
-FileIO_MsgError(FileIOResult status) // IN
+FileIO_MsgError(FileIOResult status) // IN:
{
const char *result = NULL;
FileIO_Init(FileIODescriptor *fd, // IN/OUT:
const char *pathName) // IN:
{
- ASSERT(fd);
- ASSERT(pathName);
+ ASSERT(fd != NULL);
+ ASSERT(pathName != NULL);
fd->fileName = Unicode_Duplicate(pathName);
}
void
FileIO_Cleanup(FileIODescriptor *fd) // IN/OUT:
{
- ASSERT(fd);
+ ASSERT(fd != NULL);
if (fd->fileName) {
free(fd->fileName);
* Lock the file if necessary.
*/
- ASSERT(file);
+ ASSERT(file != NULL);
ASSERT(file->lockToken == NULL);
FileIOResolveLockBits(&access);
{
FileIOResult ret = FILEIO_SUCCESS;
- ASSERT(file);
+ ASSERT(file != NULL);
#if !defined(__FreeBSD__) && !defined(sun)
if (file->lockToken != NULL) {
const char *
FileIO_Filename(FileIODescriptor *fd) // IN:
{
- ASSERT(fd);
+ ASSERT(fd != NULL);
return fd->fileName;
}
char *path;
FileIOResult ret;
- ASSERT(fd);
+ ASSERT(fd != NULL);
ASSERT(FileIO_IsValid(fd));
path = Unicode_Duplicate(fd->fileName);
{
struct iovec iov;
- ASSERT(fd);
+ ASSERT(fd != NULL);
iov.iov_base = buf;
iov.iov_len = len;
{
struct iovec iov;
- ASSERT(fd);
+ ASSERT(fd != NULL);
/* The cast is safe because FileIO_Pwritev() will not write to '*buf'. */
iov.iov_base = (void *)buf;
char *retPath;
srcPath = File_FullPath(path);
- if (!srcPath) {
+ if (srcPath == NULL) {
Log("%s: File_FullPath of '%s' failed.\n", __FUNCTION__, path);
return NULL;
}
ASSERT(tempFD && !FileIO_IsValid(tempFD));
tempPath = FileIO_AtomicTempPath(FileIO_Filename(fileFD));
- if (!tempPath) {
+ if (tempPath == NULL) {
status = FILEIO_ERROR;
goto bail;
}
char *dstFileName = NULL;
currPath = File_FullPath(FileIO_Filename(currFD));
- if (!currPath) {
+ if (currPath == NULL) {
savedErrno = errno;
Log("%s: File_FullPath of '%s' failed.\n", __FUNCTION__,
FileIO_Filename(currFD));
}
newPath = File_FullPath(FileIO_Filename(newFD));
- if (!newPath) {
+ if (newPath == NULL) {
savedErrno = errno;
Log("%s: File_FullPath of '%s' failed.\n", __FUNCTION__,
FileIO_Filename(newFD));
File_GetPathName(newPath, &dirName, &fileName);
File_GetPathName(currPath, &dstDirName, &dstFileName);
- ASSERT(dirName);
+ ASSERT(dirName != NULL);
ASSERT(fileName && *fileName);
- ASSERT(dstDirName);
+ ASSERT(dstDirName != NULL);
ASSERT(dstFileName && *dstFileName);
ASSERT(File_IsSameFile(dirName, dstDirName));
char *prev;
char *result;
- ASSERT(pathName);
+ ASSERT(pathName != NULL);
path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_UTF8);
ASSERT(path != NULL);
File_SetFilePermissions(const char *pathName, // IN:
int perms) // IN: permissions
{
- ASSERT(pathName);
+ ASSERT(pathName != NULL);
if (Posix_Chmod(pathName, perms) == -1) {
/* The error is not critical, just log it. */
char *pathName;
char *baseName;
- ASSERT(canPath);
+ ASSERT(canPath != NULL);
ASSERT(File_IsFullPath(*canPath));
if (Unicode_Compare(*canPath, DIRSEPS) == 0) {
int ret = -1;
FS_PartitionListResult *fsAttrs = NULL;
- if (!versionNum) {
+ if (versionNum == NULL) {
errno = EINVAL;
goto exit;
}
int ret = -1;
FS_PartitionListResult *fsAttrs = NULL;
- if (!blockSize) {
+ if (blockSize == NULL) {
errno = EINVAL;
goto exit;
}
* File_GetVMFSFSType works much faster on directories, so get the
* directory.
*/
- if (!File_IsFullPath(pathName)) {
+
+ if (File_IsFullPath(pathName)) {
+ fullPath = pathName;
+ } else {
tempPath = File_FullPath(pathName);
fullPath = tempPath;
- } else {
- fullPath = pathName;
}
File_GetPathName(fullPath, &dir, NULL);
res = File_GetVMFSFSType(dir, -1, &fsTypeNum);
size_t used;
char *ret = NULL;
- ASSERT(canPath);
- ASSERT(bind);
+ ASSERT(canPath != NULL);
+ ASSERT(bind != NULL);
size = 4 * FILE_MAXPATH; // Should suffice for most locales
}
ptr = strrchr(result, DIRSEPC);
- if (!ptr) {
+ if (ptr == NULL) {
ptr = result;
}
*ptr = '\0';
struct statfs stfs2;
#endif
- ASSERT(path1);
- ASSERT(path2);
+ ASSERT(path1 != NULL);
+ ASSERT(path2 != NULL);
/*
* First take care of the easy checks. If the paths are identical, or if
uint64 value = 0;
uint64 mask;
- ASSERT(fd);
- ASSERT(fileSize);
+ ASSERT(fd != NULL);
+ ASSERT(fileSize != NULL);
if (!getMaxFileSize) {
return FileIO_SupportsFileSize(fd, *fileSize);
char *path;
FileIODescriptor fd;
- ASSERT(fileSize);
+ ASSERT(fileSize != NULL);
temp = Unicode_Append(dirName, "/.vmBigFileTest");
posixFD = File_MakeSafeTemp(temp, &path);
char *dirPath = NULL;
- ASSERT(maxFileSize);
+ ASSERT(maxFileSize != NULL);
fullPath = File_FullPath(pathName);
if (fullPath == NULL) {
char *folderPath;
Bool retval = FALSE;
- ASSERT(fileSize);
+ ASSERT(pathName != NULL);
+ ASSERT(fileSize != NULL);
/*
* We acquire the full path name for testing in
{
Bool result;
- if (!maxFileSize) {
+ if (maxFileSize == NULL) {
Log(LGPFX" %s: maxFileSize passed as NULL.\n", __func__);
return FALSE;
char **path) // OUT:
{
ASSERT(context);
- ASSERT(path);
+ ASSERT(path != NULL);
errno = 0; // Any errors showed up at "start time".