Re: test diff: unmap needs flags

2012-05-08 Thread Ralf Horstmann
Hi,

compiles and boots on alpha:

uvm_km_kmem_grow: grown to 0xfe001000
OpenBSD 5.1-current (GENERIC) #0: Tue May  8 02:12:19 CEST 2012
root@alpha.internal:/usr/src/sys/arch/alpha/compile/GENERIC
AlphaStation 255/300, 298MHz
8192 byte page size, 1 processor.
real mem = 268435456 (256MB)
rsvd mem = 2048000 (1MB)
avail mem = 253272064 (241MB)
mainbus0 at root
cpu0 at mainbus0: ID 0 (primary), 21064A-0 (unknown minor type 0)

Cheers,
Ralf



Anneler Gününe Özel Notebook 195 TL

2012-05-08 Thread Rıza Şimşek
Resimleri gvremiyor musunuz? Resimleri gvsteri segin ya da bu iletiyi
tarayD1cD1nD1zda gvr|nt|leyin.
Bilgilendirme e-postalarD1nD1 almak istemiyorsanD1z l|tfen tD1klayD1n.

[IMAGE]

[IMAGE]

[IMAGE]

Anneler g|n|ne kadar t|m kameralD1 notebook ve
netbooklarda %18 kdv bizden
|stelik sadece 295 TL

[IMAGE]

AyrD1ca centrino notebooklar 195 TL

detaylar igin 0530 773 31 84

D0nvn| Cad. Teknik Han 38/3 G|m|Esuyu, Taksim D0STANBUL

[IMAGE]



Re: mg(1): bug in writeout() function

2012-05-08 Thread Mark Lumsden
writeout() writes the data in a buffer to a file. Currently, it also uses the
fupdstat() function to update the buffer statistics (fi_mode, fi_mtime..etc),
once the writing has been done. However, one of the two uses of writeout
introduces a bug where the fupdstat function is called using the wrong file
name! This is using the C-c C-w (write-file) function where the old file name
is used instead of the new one to gather stats. 

To see the bug in action

$ mg somefile

C-c C-w

Write file: somefile1

Make a change to the new file (but don't save it), then...

C-x c (to exit mg)

Save file somefile1? (y or n) y enter

You will receive a message:

File has changed on disk since last save. Save anyway? (yes or no)

The message is received in error since the stats for somefile1 are holding
the stats for somefile. 

Here is a slightly modifed diff, it returns FALSE from writeout() when
writeout is unable to write a file, arguably this is a second bug fixed
with this diff.
 
-lum

Index: file.c
===
RCS file: /cvs/src/usr.bin/mg/file.c,v
retrieving revision 1.77
diff -u -p -r1.77 file.c
--- file.c  11 Apr 2012 14:16:57 -  1.77
+++ file.c  8 May 2012 11:40:55 -
@@ -530,6 +530,7 @@ filewrite(int f, int n)
free(curbp-b_bname);
if ((curbp-b_bname = strdup(bn)) == NULL)
return (FALSE);
+   (void)fupdstat(curbp);
curbp-b_flag = ~(BFBAK | BFCHG);
upmodes(curbp);
}
@@ -595,6 +596,7 @@ buffsave(struct buffer *bp)
return (s);
}
if ((s = writeout(bp, bp-b_fname)) == TRUE) {
+   (void)fupdstat(bp);
bp-b_flag = ~(BFCHG | BFBAK);
upmodes(bp);
}
@@ -651,8 +653,8 @@ writeout(struct buffer *bp, char *fn)
/* print a message indicating write error */
(void)ffclose(bp);
ewprintf(Unable to write %s, fn);
+   return (FALSE);
}
-   (void)fupdstat(bp);
return (s == FIOSUC);
 }



Re: cron: fix incorrect error message

2012-05-08 Thread Okan Demirmen
On Tue 2012.05.08 at 00:07 -0400, Lawrence Teo wrote:
 This diff fixes the error message for one of the log_it() calls in cron
 (was probably a pasto).  While here, also fix the style for two other
 log_it() calls.
 
 Lawrence
 
 Index: cron.c
 ===
 RCS file: /cvs/src/usr.sbin/cron/cron.c,v
 retrieving revision 1.43
 diff -u -p -r1.43 cron.c
 --- cron.c22 Aug 2011 19:32:42 -  1.43
 +++ cron.c8 May 2012 03:42:12 -
 @@ -100,7 +100,7 @@ main(int argc, char *argv[]) {
   set_cron_cwd();
  
   if (putenv(PATH=_PATH_DEFPATH)  0) {
 - log_it(CRON, getpid(), DEATH, can't malloc);
 + log_it(CRON, getpid(), DEATH, can't set PATH);

Not really a pasto; from putenv():

P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));
if (!P)
return (-1);

Of course, further up, one can get -1 from putenv() if '=' is missing,
but we already sent that char, so really, the above is an accurate
message...especially since this check is done early.

   exit(EXIT_FAILURE);
   }
  
 @@ -113,7 +113,7 @@ main(int argc, char *argv[]) {
   } else if (NoFork == 0) {
   switch (fork()) {
   case -1:
 - log_it(CRON,getpid(),DEATH,can't fork);
 + log_it(CRON, getpid(), DEATH, can't fork);
   exit(EXIT_FAILURE);
   break;
   case 0:
 @@ -126,7 +126,7 @@ main(int argc, char *argv[]) {
   if (fd != STDERR_FILENO)
   (void) close(fd);
   }
 - log_it(CRON,getpid(),STARTUP,CRON_VERSION);
 + log_it(CRON, getpid(), STARTUP, CRON_VERSION);
   break;
   default:
   /* parent process should just die */



mg(1) Save throwaway buffers

2012-05-08 Thread Mark Lumsden
emacs allows you to save throwaway buffers, e.g. *scratch*, by using C-x s if
their contents have changed. Also, if a throwaway buffer has changed and you
exit emacs via C-x c you are not asked to save it.

Currently, mg adheres to emacs behaviour on the second point but not on the 
first. You receive a 'No file name' message when trying to save a throwaway
buffer. 

This diff brings mg into line with emacs and allows you to save a throwaway
buffer but doesn't change the exiting behaviour.

comments/ok?

-lum

Index: file.c
===
RCS file: /cvs/src/usr.bin/mg/file.c,v
retrieving revision 1.78
diff -u -p -r1.78 file.c
--- file.c  8 May 2012 15:26:31 -   1.78
+++ file.c  8 May 2012 15:36:56 -
@@ -549,7 +549,10 @@ static int makebackup = MAKEBACKUP;
 int
 filesave(int f, int n)
 {
-   return (buffsave(curbp));
+   if (curbp-b_fname[0] == '\0')
+   return (filewrite(f, n));
+   else
+   return (buffsave(curbp));
 }
 
 /*



Lançamento Superonline Brasil...Garanta sua posição no Topo... - 43834

2012-05-08 Thread centerift
43834



 http://www.superonlinebrasil.com.br/

Ola amigo(a) Internalta.
Convido Vocj a conhecer esse langamento no Brasil.
Transforme suas compras do dia a dia de supermercado em um grande
negscio para aumentar seus ganhos reais em dinheiro mjs a mjs.
Chega ao Brasil a Superonline, uma Empresa com mais de 5 anos de mercado
na europa.
Faga parte de grande negscio, venha para o topo, o cadastro i gratis ati
o langamento.
Btnus em dinheiro em matriz forgada 5 x 10 entre outros ganhos.

Acesse: http://www.superonlinebrasil.com.br
http://www.superonlinebrasil.com.br/
Tenha todas as informagues necessaris para estar na nossa Equipe
Superonline Brasil atravis do link acima, inclusive conferjncias.
Aproveite seu tempo livre, comece a desenvolver conosco mais uma fonte
de renda.
Obrigado, Guerra.

Talvez isso lhe interesse:
http://www.zekrewards.net http://www.zekrewards.net/

http://www.frpromotora.org http://www.frpromotora.org/

http://www.wazzu-b.com http://www.wazzu-b.com/

43834



Re: cron: fix incorrect error message

2012-05-08 Thread Thomas Pfaff
On Tue, 8 May 2012 09:55:53 -0400
Okan Demirmen o...@demirmen.com wrote:
 
 Not really a pasto; from putenv():
 
   P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));

*puke*

Ok?

Index: setenv.c
===
RCS file: /cvs/src/lib/libc/stdlib/setenv.c,v
retrieving revision 1.13
diff -u -p -r1.13 setenv.c
--- setenv.c23 Aug 2010 22:31:50 -  1.13
+++ setenv.c8 May 2012 16:13:01 -
@@ -71,7 +71,7 @@ putenv(char *str)
for (P = environ; *P != NULL; P++)
;
cnt = P - environ;
-   P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));
+   P = realloc(lastenv, sizeof(char *) * (cnt + 2));
if (!P)
return (-1);
if (lastenv != environ)
@@ -127,7 +127,7 @@ setenv(const char *name, const char *val
for (P = environ; *P != NULL; P++)
;
cnt = P - environ;
-   P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));
+   P = realloc(lastenv, sizeof(char *) * (cnt + 2));
if (!P)
return (-1);
if (lastenv != environ)



Re: cron: fix incorrect error message

2012-05-08 Thread Joerg Sonnenberger
On Tue, May 08, 2012 at 06:19:55PM +0200, Thomas Pfaff wrote:
 On Tue, 8 May 2012 09:55:53 -0400
 Okan Demirmen o...@demirmen.com wrote:
  
  Not really a pasto; from putenv():
  
  P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));
 
 *puke*
 
 Ok?

If you want to drop the first cast, you might want to spell it
sizeof(*P) as well...

Joerg



Re: cron: fix incorrect error message

2012-05-08 Thread Thomas Pfaff
On Tue, 8 May 2012 18:22:51 +0200
Joerg Sonnenberger jo...@britannica.bec.de wrote:

 On Tue, May 08, 2012 at 06:19:55PM +0200, Thomas Pfaff wrote:
  On Tue, 8 May 2012 09:55:53 -0400
  Okan Demirmen o...@demirmen.com wrote:
   
   Not really a pasto; from putenv():
   
 P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));
  
  *puke*
  
  Ok?
 
 If you want to drop the first cast, you might want to spell it
 sizeof(*P) as well...


Sure,

Index: setenv.c
===
RCS file: /cvs/src/lib/libc/stdlib/setenv.c,v
retrieving revision 1.13
diff -u -p -r1.13 setenv.c
--- setenv.c23 Aug 2010 22:31:50 -  1.13
+++ setenv.c8 May 2012 16:47:57 -
@@ -71,11 +71,11 @@ putenv(char *str)
for (P = environ; *P != NULL; P++)
;
cnt = P - environ;
-   P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));
+   P = realloc(lastenv, sizeof(*P) * (cnt + 2));
if (!P)
return (-1);
if (lastenv != environ)
-   memcpy(P, environ, cnt * sizeof(char *));
+   memcpy(P, environ, cnt * sizeof(*P));
lastenv = environ = P;
environ[cnt] = str;
environ[cnt + 1] = NULL;
@@ -127,11 +127,11 @@ setenv(const char *name, const char *val
for (P = environ; *P != NULL; P++)
;
cnt = P - environ;
-   P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2));
+   P = realloc(lastenv, sizeof(*P) * (cnt + 2));
if (!P)
return (-1);
if (lastenv != environ)
-   memcpy(P, environ, cnt * sizeof(char *));
+   memcpy(P, environ, cnt * sizeof(*P));
lastenv = environ = P;
offset = cnt;
environ[cnt + 1] = NULL;