Re: CVS commit: src/usr.bin/audio/record

2011-09-22 Thread Marc Balmer

Am 21.09.2011 um 16:32 schrieb Christos Zoulas:

 Module Name:  src
 Committed By: christos
 Date: Wed Sep 21 14:32:14 UTC 2011
 
 Modified Files:
   src/usr.bin/audio/record: record.c
 
 Log Message:
 PR/45384: Henning Petersen: Swapped arguments in lseek
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.51 -r1.52 src/usr.bin/audio/record/record.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 
 Modified files:
 
 Index: src/usr.bin/audio/record/record.c
 diff -u src/usr.bin/audio/record/record.c:1.51 
 src/usr.bin/audio/record/record.c:1.52
 --- src/usr.bin/audio/record/record.c:1.51Sat Aug 27 21:17:48 2011
 +++ src/usr.bin/audio/record/record.c Wed Sep 21 10:32:14 2011
 @@ -1,4 +1,4 @@
 -/*   $NetBSD: record.c,v 1.51 2011/08/28 01:17:48 joerg Exp $*/
 +/*   $NetBSD: record.c,v 1.52 2011/09/21 14:32:14 christos Exp $ */
 
 /*
  * Copyright (c) 1999, 2002, 2003, 2005, 2010 Matthew R. Green
 @@ -32,7 +32,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
 -__RCSID($NetBSD: record.c,v 1.51 2011/08/28 01:17:48 joerg Exp $);
 +__RCSID($NetBSD: record.c,v 1.52 2011/09/21 14:32:14 christos Exp $);
 #endif
 
 
 @@ -755,7 +755,7 @@
   if (outfd == STDOUT_FILENO)
   return;
 
 - if (lseek(outfd, SEEK_SET, 0)  0)
 + if (lseek(outfd, (off_t)0, SEEK_SET) == (off_t)-1)
   err(1, could not seek to start of file for header rewrite);

Fwiw, this never caused a problem since SEEK_SET is defined 0.  But why is an 
explicit typecast to off_t needed?  Aren't integer cast automatically?


write_header();
 
 }
 


Freundliche GrĂ¼sse,
micro systems

Marc Balmer

--
Marc Balmer
micro systems, Wiesendamm 2a, Postfach, 4019 Basel
fon +41 61 383 05 10, fax +41 61 383 05 12, http://www.msys.ch/



Re: CVS commit: src/usr.bin/audio/record

2011-09-22 Thread Christos Zoulas
In article dbe1242c-f99e-4b75-b356-516245aca...@msys.ch,
Marc Balmer  m...@msys.ch wrote:
  if (outfd == STDOUT_FILENO)
  return;
 
 -if (lseek(outfd, SEEK_SET, 0)  0)
 +if (lseek(outfd, (off_t)0, SEEK_SET) == (off_t)-1)
  err(1, could not seek to start of file for header rewrite);

Fwiw, this never caused a problem since SEEK_SET is defined 0.  But why
is an explicit typecast to off_t needed?  Aren't integer cast
automatically?

It is belt-and-suspenders if the prototype is not in scope.

christos



Re: CVS commit: src/usr.bin/audio/record

2011-09-22 Thread Marc Balmer

Am 22.09.2011 um 19:34 schrieb Christos Zoulas:

 In article dbe1242c-f99e-4b75-b356-516245aca...@msys.ch,
 Marc Balmer  m...@msys.ch wrote:
 if (outfd == STDOUT_FILENO)
 return;
 
 -   if (lseek(outfd, SEEK_SET, 0)  0)
 +   if (lseek(outfd, (off_t)0, SEEK_SET) == (off_t)-1)
 err(1, could not seek to start of file for header rewrite);
 
 Fwiw, this never caused a problem since SEEK_SET is defined 0.  But why
 is an explicit typecast to off_t needed?  Aren't integer cast
 automatically?
 
 It is belt-and-suspenders if the prototype is not in scope.
 

In this case, wouldn't it do the right thing even without a prototype in scope? 
 Would it even compile without a prototype in scope?




Re: CVS commit: src/usr.bin/audio/record

2011-09-22 Thread David Laight
On Thu, Sep 22, 2011 at 09:28:56PM +0200, Marc Balmer wrote:
 
 Am 22.09.2011 um 19:34 schrieb Christos Zoulas:
 
  In article dbe1242c-f99e-4b75-b356-516245aca...@msys.ch,
  Marc Balmer  m...@msys.ch wrote:
if (outfd == STDOUT_FILENO)
return;
  
  - if (lseek(outfd, SEEK_SET, 0)  0)
  + if (lseek(outfd, (off_t)0, SEEK_SET) == (off_t)-1)
err(1, could not seek to start of file for header rewrite);
  
  Fwiw, this never caused a problem since SEEK_SET is defined 0.  But why
  is an explicit typecast to off_t needed?  Aren't integer cast
  automatically?
  
  It is belt-and-suspenders if the prototype is not in scope.
  
 
 In this case, wouldn't it do the right thing even without a
 prototype in scope?

Depends on the architecture.

 Would it even compile without a prototype in scope?

Depends on the compilation options.

Personally I'd compile with the missing prototype being a compile error,
and remove the cast.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/sys/fs/puffs

2011-09-22 Thread YAMAMOTO Takashi
hi,

 Module Name:  src
 Committed By: manu
 Date: Wed Sep 21 15:36:33 UTC 2011
 
 Modified Files:
   src/sys/fs/puffs: puffs_vfsops.c puffs_vnops.c
 
 Log Message:
 Make sure ioflush does not sleep in PUFFS code path, waiting for a mutex,
 a memory allocation, or a response from the filesystem.
 
 This avoids deadlocks in the following situations:
 1) when memory is low: ioflush waits the fileystem, the fielsystem waits
for memory

can you explain how it is a problem?

YAMAMOTO Takashi

 2) when the filesystem does not respond (e.g.: network outage ona
distributed filesystem)
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.96 -r1.97 src/sys/fs/puffs/puffs_vfsops.c
 cvs rdiff -u -r1.155 -r1.156 src/sys/fs/puffs/puffs_vnops.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


Re: CVS commit: src/sys

2011-09-22 Thread YAMAMOTO Takashi
hi,

 Module Name:  src
 Committed By: manu
 Date: Fri Sep 23 01:57:32 UTC 2011
 
 Modified Files:
   src/sys/fs/puffs: puffs_vnops.c
   src/sys/miscfs/syncfs: sync_subr.c
 
 Log Message:
 Fix the build that was broken by struct lwp *updateproc reference in
 RUMP-visible code. Instead of checking that updateproc (aka ioflush,
 aka syncer) will not sleep in PUFFS code, I check for any kernel thread:
 after all none of them are designed to hang awaiting for a remote filesystem
 operation to complete.

i don't think it's a good idea to restrict what kernel threads can do
in this way.  please revert.

YAMAMOTO Takashi

 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.156 -r1.157 src/sys/fs/puffs/puffs_vnops.c
 cvs rdiff -u -r1.46 -r1.47 src/sys/miscfs/syncfs/sync_subr.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.