From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lb0-f178.google.com ([209.85.217.178]) by ur; Sun Aug 23 20:04:23 EDT 2015 Received: by lbbpu9 with SMTP id pu9so70201689lbb.3 for <9front@9front.org>; Sun, 23 Aug 2015 17:04:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=RQOy/T1TMz8pZOs4S3Ld44Wwgmo5GNoJN/iNXPeKKw4=; b=NiVhwsWDZ4lqEDw20ESro1LWpDtbUF5uAwDoxjLAo5BKvwvWiyaQhyCxJdkQD+yc6y WaYXj52w/4jLpr/qLFzX1KKzZkwsBWGOHJKHZK8POyuwGepFnSxBikvCKrki/i1Hhbxm YFyXhc+z8oL5U8p+s0UCYaJQbCkijEf1dDkZ4wb925RvzDLOVjtVqqzQv8Jx/6E/gIj/ PdbNNcXAuILLzVPCQ4EXTTEYJh+r9deAyt982dvQuRGuOxkhOW1OgQCQ8rx9Ev5RoosA WcgJ0132ZG7Sx0sP4Ipg6DVIGKOqcybnMi2oEe+QHEPiaTD6pxL7GklTsN4jB/cgnd9p aMAQ== X-Gm-Message-State: ALoCoQkPX0XVkF3CVpKr1y7hPMVq41Krdg4R0VhOHUeeaRnWFdZay8F+x3PaPLvetctKEsno3XU9 X-Received: by 10.112.85.3 with SMTP id d3mr17549422lbz.33.1440374656794; Sun, 23 Aug 2015 17:04:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.20.80 with HTTP; Sun, 23 Aug 2015 17:03:57 -0700 (PDT) In-Reply-To: References: <8a7a4824b69f9c20955f.1440373756@delta> From: Nick Owens Date: Sun, 23 Aug 2015 17:03:57 -0700 Message-ID: List-ID: <9front.9front.org> X-Glyph: ➈ X-Bullshit: agile self-signing cloud just-in-time GPU solution Subject: Re: [9front] [PATCH 6 of 8] mv: use iounit for reads To: 9front@9front.org Content-Type: multipart/alternative; boundary=001a1134946cc31a6a051e035b4a --001a1134946cc31a6a051e035b4a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable woops, fixed. thanks. On Sun, Aug 23, 2015 at 5:01 PM, Iruat=C3=A3 Souza wr= ote: > > Em 23/08/2015 20:52, "mischief" escreveu: > > > > # HG changeset patch > > # User mischief > > # 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 =3D iounit(fdf); > > + if(buflen <=3D 0) > > + buflen =3D IOUNIT; > > + > > while ((n =3D read(fdf, buf, sizeof buf)) > 0) { > > n1 =3D write(fdt, buf, n); > > if(n1 !=3D n){ > > You don't seem to reserve memory for buf here. > --001a1134946cc31a6a051e035b4a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
woops, fixed. thanks.

=
On Sun, Aug 23, 2015 at 5:01 PM, Iruat=C3=A3 Sou= za <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
> #=C2=A0 =C2=A0 =C2=A0 Sun Aug 23 14:51:27 2015 -0700
> # Node ID 8a7a4824b69f9c20955f3b96a01c142801f5af1f
> # Parent=C2=A0 b6676a7790ca84598ccc4e66856339710ab9b544
> mv: use iounit for reads
>
> diff -r b6676a7790ca -r 8a7a4824b69f sys/src/cmd/mv.c
> --- a/sys/src/cmd/mv.c=C2=A0 Sun Aug 23 14:51:27 2015 -0700
> +++ b/sys/src/cmd/mv.c=C2=A0 Sun Aug 23 14:51:27 2015 -0700
> @@ -167,9 +167,14 @@
> =C2=A0int
> =C2=A0copy1(int fdf, int fdt, char *from, char *to)
> =C2=A0{
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0char buf[8192];
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0int buflen;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0char *buf;
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 long n, n1;
>
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0buflen =3D iounit(fdf);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0if(buflen <=3D 0)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0buflen =3D IOU= NIT;
> +
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 while ((n =3D read(fdf, buf, sizeof buf)) = > 0) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 n1 =3D write(f= dt, buf, n);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if(n1 !=3D n){=

You don't seem to reserve memory for buf her= e.


--001a1134946cc31a6a051e035b4a--