9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Nick Owens <mischief@offblast.org>
To: 9front@9front.org
Subject: Re: [9front] [PATCH 6 of 8] mv: use iounit for reads
Date: Sun, 23 Aug 2015 17:03:57 -0700	[thread overview]
Message-ID: <CAH_zEu73Fg2p8fsf5p6E95_D4kYihEApr9iQODJ_D+itS2eMcw@mail.gmail.com> (raw)
In-Reply-To: <CABJnqBQV1qjWg6GvVFb27s=ijiJpeQM0opk=9=dMT3AQ+=bHCg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1159 bytes --]

woops, fixed. thanks.

On Sun, Aug 23, 2015 at 5:01 PM, Iruatã Souza <iru.muzgo@gmail.com> wrote:

>
> Em 23/08/2015 20:52, "mischief" <mischief@offblast.org> escreveu:
> >
> > # HG changeset patch
> > # User mischief <mischief@offblast.org>
> > # Date 1440366687 25200
> > #      Sun Aug 23 14:51:27 2015 -0700
> > # Node ID 8a7a4824b69f9c20955f3b96a01c142801f5af1f
> > # Parent  b6676a7790ca84598ccc4e66856339710ab9b544
> > mv: use iounit for reads
> >
> > diff -r b6676a7790ca -r 8a7a4824b69f sys/src/cmd/mv.c
> > --- a/sys/src/cmd/mv.c  Sun Aug 23 14:51:27 2015 -0700
> > +++ b/sys/src/cmd/mv.c  Sun Aug 23 14:51:27 2015 -0700
> > @@ -167,9 +167,14 @@
> >  int
> >  copy1(int fdf, int fdt, char *from, char *to)
> >  {
> > -       char buf[8192];
> > +       int buflen;
> > +       char *buf;
> >         long n, n1;
> >
> > +       buflen = iounit(fdf);
> > +       if(buflen <= 0)
> > +               buflen = IOUNIT;
> > +
> >         while ((n = read(fdf, buf, sizeof buf)) > 0) {
> >                 n1 = write(fdt, buf, n);
> >                 if(n1 != n){
>
> You don't seem to reserve memory for buf here.
>

[-- Attachment #2: Type: text/html, Size: 1875 bytes --]

  reply	other threads:[~2015-08-24  0:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23 23:49 [PATCH 0 of 8] 48k iounit mischief
2015-08-23 23:49 ` [PATCH 1 of 8] devmnt: set MAXRPC to IOHDRSZ+48K mischief
2015-08-23 23:49 ` [PATCH 2 of 8] libc: define default IOUNIT as 48K mischief
2015-08-23 23:49 ` [PATCH 4 of 8] cwfs: use IOUNIT as MAXDAT, fix Msgbuf count overflow when MAXDAT > 2^15-1 mischief
2015-08-23 23:49 ` [PATCH 5 of 8] dossrv: set buffer size to IOUNIT mischief
2015-08-23 23:49 ` [PATCH 6 of 8] mv: use iounit for reads mischief
2015-08-24  0:01   ` [9front] " Iruatã Souza
2015-08-24  0:03     ` Nick Owens [this message]
2015-08-23 23:49 ` [PATCH 7 of 8] tee: " mischief
2015-08-23 23:49 ` [PATCH 8 of 8] tput: use iounit for reads, check sbrk return value mischief

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH_zEu73Fg2p8fsf5p6E95_D4kYihEApr9iQODJ_D+itS2eMcw@mail.gmail.com \
    --to=mischief@offblast.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).