#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#include <stdio.h>
#include <sys/types.h>
#include <strings.h>
#endif
-#ifdef O_LARGEFILE
-#define afs_open open64
-#else /* !O_LARGEFILE */
-#define afs_open open
-#endif /* !O_LARGEFILE */
-
-
/* Note: the volume creation functions herein leave the destroyMe flag in the
volume header ON: this means that the volumes will not be attached by the
file server and WILL BE DESTROYED the next time a system salvage is performed */
vol.stamp.version = VOLUMEINFOVERSION;
vol.destroyMe = DESTROY_ME;
(void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_printable_uint32_lu(vol.id));
- (void)afs_snprintf(volumePath, sizeof volumePath, "%s/%s",
+ (void)afs_snprintf(volumePath, sizeof volumePath, "%s" OS_DIRSEP "%s",
VPartitionPath(partition), headerName);
rc = stat(volumePath, &st);
if (rc == 0 || errno != ENOENT) {
IHandle_t *lh;
int code;
-#ifdef AFS_NT40_ENV
- *(p->inode) = nt_MakeSpecIno(VI_LINKTABLE);
-#else
*(p->inode) = namei_MakeSpecIno(vol.parentId, VI_LINKTABLE);
-#endif
IH_INIT(lh, device, parentId, *(p->inode));
fdP = IH_OPEN(lh);
if (fdP == NULL) {
}
if (FDH_PWRITE(fdP, (char *)&p->stamp, sizeof(p->stamp), 0) !=
sizeof(p->stamp)) {
- Log("VCreateVolume: Problem writing to inode %s (err=%d)\n",
+ Log("VCreateVolume: Problem writing to inode %s (err=%d)\n",
PrintInode(stmp, *(p->inode)), errno);
FDH_REALLYCLOSE(fdP);
goto bad;
char path[MAXPATHLEN];
(void)afs_snprintf(path, sizeof(path),
- "%s/" VFORMAT,
+ "%s" OS_DIRSEP VFORMAT,
VPartitionPath(dp), afs_printable_uint32_lu(volid));
fd = open(path, O_RDONLY);
if (fd < 0) {
flags |= O_RDWR;
(void)afs_snprintf(path, sizeof(path),
- "%s/" VFORMAT,
+ "%s" OS_DIRSEP VFORMAT,
VPartitionPath(dp), afs_printable_uint32_lu(hdr->id));
fd = open(path, flags, 0644);
if (fd < 0) {
#endif /* AFS_DEMAND_ATTACH_FS */
(void)afs_snprintf(path, sizeof(path),
- "%s/" VFORMAT,
+ "%s" OS_DIRSEP VFORMAT,
VPartitionPath(dp), afs_printable_uint32_lu(volid));
code = unlink(path);
if (code) {
int locked, void *rock)
{
int error = 0;
- int fd;
+ FD_t fd;
- if ((fd = afs_open(name, O_RDONLY)) == -1
- || read(fd, hdr, sizeof(*hdr))
+ if ((fd = OS_OPEN(name, O_RDONLY, 0)) == INVALID_FD
+ || OS_READ(fd, hdr, sizeof(*hdr))
!= sizeof(*hdr)
|| hdr->stamp.magic != VOLUMEHEADERMAGIC) {
error = 1;
}
- if (fd >= 0) {
- close(fd);
+ if (fd != INVALID_FD) {
+ OS_CLOSE(fd);
}
#ifdef AFSFS_DEMAND_ATTACH_FS
if (p != NULL && strcmp(p, VHDREXT) == 0) {
char name[VMAXPATHLEN];
- sprintf(name, "%s/%s", partpath, dentry->d_name);
+ sprintf(name, "%s" OS_DIRSEP "%s", partpath, dentry->d_name);
code = _VHandleVolumeHeader(dp, volfunc, name, &diskHeader, -1, rock);
if (code < 0) {