search for: s_ifmt

Displaying 20 results from an estimated 28 matches for "s_ifmt".

2005 Oct 16
1
getting dmraid to use klibc
...m not subscribed] Hi, I'm trying to get dmraid 1.0.0rc9 [0] to compile with --enable-klibc, however I have some troubles with mkfifo defined in /usr/lib/klibc/include/sys/stat.h. /usr/lib/klibc/include/sys/stat.h: In function 'mkfifo': /usr/lib/klibc/include/sys/stat.h:28: error: 'S_IFMT' undeclared (first use in this function) after investigating a little I found out that <features.h> is being included (is this right?) and defines __GLIBC__ and thus S_IFMT is not being defined from /usr/include/linux/stat.h:10 of course this fixes the problem in features.h:291 #ifndef...
2000 Aug 18
0
[PATCH] Support symlinks in scp of openssh 2
...fd = -1; + result = lstat(name, &stb); + } + else { + if ((fd = open(name, O_RDONLY, 0)) < 0) + goto syserr; + result = fstat(fd, &stb); + } + if (result < 0) { syserr: run_err("%s: %s", name, strerror(errno)); goto next; } switch (stb.st_mode & S_IFMT) { + case S_IFLNK: + /* readlink later */ + break; case S_IFREG: + if (fd < 0 && (fd = open(name, O_RDONLY, 0)) < 0) + goto syserr; break; case S_IFDIR: @@ -586,6 +606,7 @@ syserr: run_err("%s: %s", name, strerr } #define FILEMODEMASK (S_ISUID|S_ISG...
2009 Mar 06
0
[PATCH 2/3] COM32 API: restructure DIR
...dn't be needed? */ if ((!(regs.eflags.l & EFLAGS_CF)) && (regs.esi.w[0] != 0)) { - newde = calloc(1, sizeof(newde)); - if (newde != NULL) { - strcpy(newde->d_name, __com32.cs_bounce); - newde->d_mode = regs.edx.w[0]; - newde->d_type = (newde->d_mode & S_IFMT) >> 12; - newde->d_size = regs.eax.l; - newde->d_ino = regs.ebx.l; - dir->dd_stat = 1; - } else { - dir->dd_stat = -2; - errno = ENOMEM; - } + newde = dir->dd_de; + strcpy(newde->d_name, __com32.cs_bounce); + newde->d_mode = regs.edx.w[0]; + new...
2010 Oct 08
1
patch for mysterious maildir symlink error
...st" errors. --- a/src/lib-storage/index/maildir/maildir-util.c +++ b/src/lib-storage/index/maildir/maildir-util.c @@ -91,7 +91,7 @@ { struct stat st; - if (lstat(path, &st) == 0 && (st.st_mode & S_IFLNK) != 0) { + if (lstat(path, &st) == 0 && (st.st_mode & S_IFMT) == S_IFLNK) { /* most likely a symlink pointing to a nonexistent file */ mail_storage_set_critical(&mbox->storage->storage, "Maildir: Symlink destination doesn't exist: %s", path);
2001 Jun 07
0
non-ansi function in openbsd-compat
...ykstra *** openbsd-compat/strmode.c.O Wed Jun 6 17:32:44 2001 --- openbsd-compat/strmode.c Wed Jun 6 17:32:59 2001 *************** *** 43,51 **** #include <string.h> void ! strmode(mode, p) ! register mode_t mode; ! register char *p; { /* print type */ switch (mode & S_IFMT) { --- 43,49 ---- #include <string.h> void ! strmode(register mode_t mode, register char *p) { /* print type */ switch (mode & S_IFMT) {
2001 Sep 12
3
lastlog with hp-ux 10.20
i haven't heard of problems with configure/lastlog on 10.20. i'll copy the development list as there are folks there who use 10.20. On Thu, 6 Sep 2001, Jesse Caldwell wrote: :one last problem with openssh -- building openssh on HPUX 10.20 fails :on loginrec.c (i don't have the errors handy but i would be more than :happy to recreate them). i get the same error with 2.9p2 and 9/6/2001
2003 Feb 08
1
compare st_mode & 07777, or Aix dirs always differ
...p to date. Here is a patch which fixes this. It causes rsync to look at only the bits that chmod actually influences, 07777, when deciding whether or not the modes differ. I was surprised there wasn't an existing constant for 07777, but I couldn't find one. I thought then to exclude the S_IFMT bits, but on Aix that has the usual value of 0170000, so it wouldn't exclude the problematic 0200000 bit. diff -r -X /home/roderick/.diff-exclude -u rsync-2.5.5/rsync.c rsync/rsync.c --- rsync-2.5.5/rsync.c Thu Dec 20 10:33:13 2001 +++ rsync/rsync.c Fri Feb 7 10:12:50 2003 @@ -203,7 +203,7 @@...
2010 Nov 19
3
File Offsets for SCP (patch)
...ffset greater than file size"); + goto next; + } + if (fd_inset > stb.st_size) { + run_err("Inset greater than file size"); + goto next; + } + lseek (fd, fd_offset, SEEK_SET); + stb.st_size -= (fd_offset + fd_inset); unset_nonblock(fd); switch (stb.st_mode & S_IFMT) { case S_IFREG:
2012 Dec 27
1
[patch] patch for fskip_ahead()
...have to use pure non-fseek() version: */ - while(offset > 0) { - const long need = (long)min(offset, sizeof(dump)); - if((long)fread(dump, 1, need, f) < need) - return false; - offset -= need; - } - } - else -#endif + if(fstat(fileno(f), &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFREG) { - while(offset > 0) { - long need = (long)min(offset, LONG_MAX); - if(fseeko(f, need, SEEK_CUR) < 0) { - need = (long)min(offset, sizeof(dump)); - if((long)fread(dump, 1, need, f) < need) - return false; - } - offset -= need; - } + if(fseeko(f, offset,...
2008 Jan 07
0
[PATCH] Replaced int with mode_t as requested
...:38:54 -0000 1.7 +++ openssh/openbsd-compat/strmode.c 7 Jan 2008 06:58:54 -0000 @@ -37,10 +37,8 @@ #include <sys/stat.h> #include <string.h> -/* XXX mode should be mode_t */ - void -strmode(int mode, char *p) +strmode(mode_t mode, char *p) { /* print type */ switch (mode & S_IFMT) {
2003 Feb 19
0
FW: compare st_mode & 07777, or Aix dirs always differ
...It causes rsync to look at only the >> bits that chmod actually influences, 07777, when deciding whether or not >> the modes differ. >> >> I was surprised there wasn't an existing constant for 07777, but I >> couldn't find one. I thought then to exclude the S_IFMT bits, but on >> Aix that has the usual value of 0170000, so it wouldn't exclude the >> problematic 0200000 bit. > >First, a tecnical note: > >Instead of all those ifndef,define,endif lines with >literals just so you can OR them, cut to the quick with > > #ifndef...
2012 Sep 03
1
[GIT-PULL] XFS filesystem driver
...c number does not match!"); + xfs_debug("magic number 0x%04x", be16_to_cpu(core->di_magic)); + goto out; + } + + fill_xfs_inode_pvt(fs, inode, XFS_INFO(fs)->rootino); + + xfs_debug("Root inode has been found!"); + + if ((be16_to_cpu(core->di_mode) & S_IFMT) != S_IFDIR) { + xfs_error("root inode is not a directory ?! No makes sense..."); + goto out; + } + + inode->ino = XFS_INFO(fs)->rootino; + inode->mode = DT_DIR; + inode->size = be64_to_cpu(core->di_size); + + return inode; + +out: + free(inode); + +...
2008 Oct 21
1
Create user home directory or user-own folder on samba server on first login to samba
Hello, I'd like to create user home directory or user-own folder on samba server on first login to samba without using PAM, so how could I do this? Thank you, Denis
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
...Jun 24 21:04:39 2008 -0400 @@ -76,6 +76,11 @@ static unsigned char btrfs_type_by_mode[ [S_IFSOCK >> S_SHIFT] = BTRFS_FT_SOCK, [S_IFLNK >> S_SHIFT] = BTRFS_FT_SYMLINK, }; + +static inline u8 btrfs_inode_type(struct inode *inode) +{ + return btrfs_type_by_mode[(inode->i_mode & S_IFMT) >> S_SHIFT]; +} int btrfs_check_free_space(struct btrfs_root *root, u64 num_required, int for_del) @@ -599,6 +604,130 @@ zeroit: return -EIO; } +/* + * Adds an unlinked/truncating inode to the hidden orphan dir for this root + * so that if something happens and the inode delet...
2009 May 29
1
[PATCH v2] klibc-utils: add simple ls
...aj + max_min + 1; + } + else { + if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_size)) > max_size) + max_size = bytes; + } + return; +} + +static void do_stat(const struct stat *st, const char *path) +{ + char *fmt, *link_name; + int rc; + + switch (st->st_mode & S_IFMT) { + case S_IFBLK: putchar('b'); break; + case S_IFCHR: putchar('c'); break; + case S_IFDIR: putchar('d'); break; + case S_IFIFO: putchar('p'); break; + case S_IFLNK: putchar('l'); break; + case S_IFSOCK: putchar('s'); break; + case S_IFRE...
2009 May 28
1
[PATCH] klibc-utils: add minils
...e { + if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_size)) > max_size) + max_size = bytes; + } + return; +} + +static void do_stat(const struct stat *st, const char *path) +{ + size_t max_siz = 128; + size_t sz; + char *fmt, *link_name; + + switch (st->st_mode & S_IFMT) { + case S_IFBLK: printf("b"); break; + case S_IFCHR: printf("c"); break; + case S_IFDIR: printf("d"); break; + case S_IFIFO: printf("p"); break; + case S_IFLNK: printf("l"); break; + case S_IFSOCK: printf("s"); break; + case...
2003 Mar 11
0
PATCH: rsyncd.conf permission options
...ectory_mode; } service; @@ -180,7 +184,11 @@ "*.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz", /* dont compress */ 0, /* timeout */ 0, /* max connections */ - False /* ignore nonreadable */ + False, /* ignore nonreadable */ + 07777, /* create mask (~S_IFMT) */ + 0, /* force create mode */ + 07777, /* directory mask */ + 0 /* force directory mode */ }; @@ -295,6 +303,10 @@ {"log format", P_STRING, P_LOCAL, &sDefault.log_format, NULL, 0}, {"refuse options", P_STRING, P_LOCAL, &sDefault.refuse_option...
2011 Jul 07
5
[PATCH 0/5] checkpatch cleanups
It seems checkpatch errors krept in, this is a first go. Next run will go into usr/kinit directory. No code changes, just codingstyle fixes (verified with size(3)). maximilian attems (5): [klibc] sleep: have argument on next line [klibc] readklink: remove unneeded braces [klibc] mount: whitespace policy [klibc] ls: fix various checkpatch complaints [klibc] tests: checkpatch fixlets
2005 Aug 04
1
[Bug 2947] stdout with [-v] -H --link-dest and slink/sock/fifo/regf
https://bugzilla.samba.org/show_bug.cgi?id=2947 wayned@samba.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Additional Comments From wayned@samba.org 2005-08-03 16:45 ------- Keep in mind that --link-dest only hard-links regular
2012 Jan 05
4
[RFC][PATCH 3/3] Btrfs: improve truncation of btrfs
...| 159 +++++++++++++++++------------------------------------- 1 files changed, 49 insertions(+), 110 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index df6060f..9ace01b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -88,7 +88,7 @@ static unsigned char btrfs_type_by_mode[S_IFMT >> S_SHIFT] = { }; static int btrfs_setsize(struct inode *inode, loff_t newsize); -static int btrfs_truncate(struct inode *inode); +static int btrfs_truncate(struct inode *inode, loff_t newsize); static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end); static noinlin...