Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Nov 27, 2007
2 parents 00a8743 + 00a8743 commit 83ab7d8
Show file tree
Hide file tree
Showing 21 changed files with 239 additions and 107 deletions.
1 change: 1 addition & 0 deletions .cvsignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
9pm
config
install.log
11 changes: 8 additions & 3 deletions bin/9fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ if(! ~ $#* 1){
}

fn srv1 {
flag=()
if(~ $1 -*){
flag=$1
shift
}
if(! 9p stat $1 >/dev/null >[2=1]){
rm -f $ns/$1
srv -a $2 $1
srv $flag $2 $1
}
}

ns=`{namespace}
switch($1){
case tip
srv1 tip utumno.tip9ug.jp
srv1 -a tip utumno.tip9ug.jp
case sources
srv1 sources sources.cs.bell-labs.com
srv1 -n sources sources.cs.bell-labs.com
case *
srv1 $1 $1
}
Expand Down
1 change: 1 addition & 0 deletions lib/moveplan9.files
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ bin/vwhois
bin/vmount
bin/yesterday
man/mkindex
tmac/tmac.an
tmac/tmac.anhtml
tmac/tmac.pm
4 changes: 4 additions & 0 deletions mail/lib/validateattachment
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ case *'zip archive'*
# but the errors look like
# unzip: reading data for philw.doc.scr failed: ...
# so we can still catch these.
if(! unzip -tsf $file >[2=1] >/dev/null){
echo corrupt zip file!
exit $discard
}
if(unzip -tsf $file >[2=1] | grep -si ' |\.(scr|exe|pif|bat|com)$'){
echo executables inside zip file!
exit $discard
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/9p.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ xls(int argc, char **argv)
}
if(sort)
qsort(d, n, sizeof d[0], dircmp);
for(j=0; j<5; j++)
for(j=0; j<4; j++)
len[j] = 0;
for(i=0; i<n; i++){
d[i].type = 'M';
Expand Down
11 changes: 10 additions & 1 deletion src/cmd/9pfuse/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ mountfuse(char *mtpt)
"/Contents/Resources/load_fusefs", 0) < 0 &&
access(f="/Library/Extensions/fusefs.kext"
"/Contents/Resources/load_fusefs", 0) < 0 &&
access(f="/Library/Filesystems"
"/fusefs.fs/Support/load_fusefs", 0) < 0 &&
access(f="/System/Library/Filesystems"
"/fusefs.fs/Support/load_fusefs", 0) < 0){
werrstr("cannot find load_fusefs");
Expand Down Expand Up @@ -843,8 +845,15 @@ mountfuse(char *mtpt)
/*
* Different versions of MacFUSE put the
* mount_fusefs binary in different places.
* Try both.
* Try all.
*/
/* Leopard location */
putenv("MOUNT_FUSEFS_DAEMON_PATH",
"/Library/Filesystems/fusefs.fs/Support/mount_fusefs");
execl("/Library/Filesystems/fusefs.fs/Support/mount_fusefs",
"mount_fusefs", buf, mtpt, nil);

/* possible Tiger locations */
execl("/System/Library/Filesystems/fusefs.fs/mount_fusefs",
"mount_fusefs", buf, mtpt, nil);
execl("/System/Library/Filesystems/fusefs.fs/Support/mount_fusefs",
Expand Down
19 changes: 14 additions & 5 deletions src/cmd/9pfuse/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,21 @@
#ifndef O_DIRECTORY
#define O_DIRECTORY 0
#endif

#ifndef O_LARGEFILE
#if defined(__linux__)
#define O_LARGEFILE 0100000 /* Sigh */
#else
#define O_LARGEFILE 0
# if defined(__linux__)
# define O_LARGEFILE 0100000 /* Sigh */
# else
# define O_LARGEFILE 0
# endif
#endif

#ifndef O_CLOEXEC
# if defined(__linux__)
# define O_CLOEXEC 02000000 /* Sigh */
# else
# define O_CLOEXEC 0
# endif
#endif


Expand Down Expand Up @@ -552,7 +561,7 @@ _fuseopen(FuseMsg *m, int isdir)
flags = in->flags;
openmode = flags&3;
flags &= ~3;
flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE);
flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC);
if(flags & O_TRUNC){
openmode |= OTRUNC;
flags &= ~O_TRUNC;
Expand Down
9 changes: 5 additions & 4 deletions src/cmd/acme/cols.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,12 @@ colwhich(Column *c, Point p)
for(i=0; i<c->nw; i++){
w = c->w[i];
if(ptinrect(p, w->r)){
if(ptinrect(p, w->tagtop) || ptinrect(p, w->tag.fr.r))
if(ptinrect(p, w->tagtop) || ptinrect(p, w->tag.all))
return &w->tag;
if(ptinrect(p, w->body.scrollr) || ptinrect(p, w->body.fr.r))
return &w->body;
return nil;
/* exclude partial line at bottom */
if(p.x >= w->body.scrollr.max.x && p.y >= w->body.fr.r.max.y)
return nil;
return &w->body;
}
}
return nil;
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/acme/look.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@ search(Text *ct, Rune *r, uint n)
fbuffree(s);
return TRUE;
}
if(around && q>=ct->q1)
break;
--nb;
b++;
q++;
if(around && q>=ct->q1)
break;
}
fbuffree(s);
return FALSE;
Expand Down
10 changes: 8 additions & 2 deletions src/cmd/upas/nfs/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,19 @@ int
imapcopylist(Imap *z, char *nbox, Msg **m, uint nm)
{
int rv;
char *name;
char *name, *p;

if(nm == 0)
return 0;

qlock(&z->lk);
name = esmprint("%Z", nbox);
if(strcmp(nbox, "mbox") == 0)
name = estrdup("INBOX");
else{
p = esmprint("%s%s", z->root, nbox);
name = esmprint("%Z", p);
free(p);
}
rv = imaplistcmd(z, m[0]->box, "UID COPY", m, nm, name);
free(name);
qunlock(&z->lk);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/upas/vf/unvf.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main(void)
while((p = Brdstr(&b, '\n', 1)) != nil){
if(p[0] == 0)
break;
if(strncmp(p, "Content-Transfer-Encoding: ", 27) == 0)
if(cistrncmp(p, "Content-Transfer-Encoding: ", 27) == 0)
encoding = strdup(p+27);
free(p);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/vbackup/diskcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ main(int argc, char **argv)
if((disk = diskcache(disk, 16384, 16)) == nil)
sysfatal("diskcache: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");

zero = emalloc(fsys->blocksize);
fprint(2, "%d blocks total\n", fsys->nblock);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/vbackup/diskftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ threadmain(int argc, char **argv)
if((disk = diskcache(disk, 16384, 16)) == nil)
sysfatal("diskcache: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");

allowall = 1;
memset(&au, 0, sizeof au);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/vbackup/disknfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ threadmain(int argc, char **argv)
sysfatal("diskcache: %r");

if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");

nfs3chan = chancreate(sizeof(SunMsg*), 0);
mountchan = chancreate(sizeof(SunMsg*), 0);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/vbackup/vbackup.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ threadmain(int argc, char **argv)
if((disk = diskcache(disk, 32768, 2*MAXQ+16)) == nil)
sysfatal("diskcache: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");

/*
* connect to venti
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/vbackup/vcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ threadmain(int argc, char **argv)
if((disk = diskopenventi(c, score)) == nil)
sysfatal("diskopenventi: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");

zero = emalloc(fsys->blocksize);
fprint(2, "%d blocks total\n", fsys->nblock);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/vbackup/vftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ threadmain(int argc, char **argv)
sysfatal("diskopenventi: %r");
}
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");

fprint(2, "block size %d\n", fsys->blocksize);
buf = emalloc(fsys->blocksize);
Expand Down
2 changes: 1 addition & 1 deletion src/lib9/_p9dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ _p9dir(struct stat *lst, struct stat *st, char *name, Dir *d, char **str, char *
close(fd);
}
#endif
#if defined(__FreeBSD__)
#if defined(DIOCGMEDIASIZE)
if(isdisk(st)){
int fd;
off_t mediasize;
Expand Down
5 changes: 5 additions & 0 deletions src/lib9/getns.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ nsfromdisplay(void)
if(strcmp(p, ".0") == 0)
*p = 0;
}

/* turn /tmp/launch/:0 into _tmp_launch_:0 (OS X 10.5) */
for(p=disp; *p; p++)
if(*p == '/')
*p = '_';

p = smprint("/tmp/ns.%s.%s", getuser(), disp);
free(disp);
Expand Down
Loading

0 comments on commit 83ab7d8

Please sign in to comment.