[LON-CAPA-cvs] cvs: loncom / lond

foxr lon-capa-cvs@mail.lon-capa.org
Sat, 01 Mar 2003 04:18:22 -0000


This is a MIME encoded message

--foxr1046492302
Content-Type: text/plain

foxr		Fri Feb 28 23:18:22 2003 EDT

  Modified files:              
    /loncom	lond 
  Log:
  Replace $! in textual messages with concatenation with ($!+0) so that the 
  numerical errno is returned.
  
  
--foxr1046492302
Content-Type: text/plain
Content-Disposition: attachment; filename="foxr-20030228231822.txt"

Index: loncom/lond
diff -u loncom/lond:1.108 loncom/lond:1.109
--- loncom/lond:1.108	Mon Feb  3 13:03:52 2003
+++ loncom/lond	Fri Feb 28 23:18:22 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.108 2003/02/03 18:03:52 harris41 Exp $
+# $Id: lond,v 1.109 2003/03/01 04:18:22 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -855,7 +855,8 @@
                                $fpnow.='/'.$fpparts[$i]; 
                                unless (-e $fpnow) {
 				   unless (mkdir($fpnow,0777)) {
-                                      $fperror="error:$!";
+                                      $fperror="error: ".($!+0)
+					  ." mkdir failed\n";
                                    }
                                }
                            }
@@ -1026,7 +1027,8 @@
                             print $hfh "$now:$hostid{$clientip}:$what\n";
                             print $client "ok\n"; 
 			} else {
-                            print $client "error:$!\n";
+                            print $client "error: ".($!+0)
+				." IO::File->new Failed\n";
 		        }
 		       }
 # ------------------------------------------------------------------------- put
@@ -1054,10 +1056,12 @@
 			   if (untie(%hash)) {
                               print $client "ok\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!)
+			       ." tie(GDBM) Failed\n";
                        }
 		      } else {
                           print $client "refused\n";
@@ -1096,10 +1100,12 @@
 			   if (untie(%hash)) {
                               print $client "ok\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 		      } else {
                           print $client "refused\n";
@@ -1122,10 +1128,12 @@
 		              $qresult=~s/\&$//;
                               print $client "$qresult\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ------------------------------------------------------------------------ eget
                    } elsif ($userinput =~ /^eget/) {
@@ -1158,10 +1166,12 @@
 			        print $client "error:no_key\n";
                               }
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ------------------------------------------------------------------------- del
                    } elsif ($userinput =~ /^del/) {
@@ -1186,10 +1196,12 @@
 			   if (untie(%hash)) {
                               print $client "ok\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ------------------------------------------------------------------------ keys
                    } elsif ($userinput =~ /^keys/) {
@@ -1207,10 +1219,12 @@
 		              $qresult=~s/\&$//;
                               print $client "$qresult\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ----------------------------------------------------------------- dumpcurrent
                    } elsif ($userinput =~ /^currentdump/) {
@@ -1248,10 +1262,12 @@
                              chop($qresult);
                              print $client "$qresult\n";
                            } else {
-                             print $client "error:$!\n";
+                             print $client "error: ".($!+0)
+				 ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ------------------------------------------------------------------------ dump
                    } elsif ($userinput =~ /^dump/) {
@@ -1282,10 +1298,12 @@
                                chop($qresult);
                                print $client "$qresult\n";
                            } else {
-                               print $client "error:$!\n";
+                               print $client "error: ".($!+0)
+				   ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ----------------------------------------------------------------------- store
                    } elsif ($userinput =~ /^store/) {
@@ -1322,10 +1340,12 @@
 			   if (untie(%hash)) {
                               print $client "ok\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 		      } else {
                           print $client "refused\n";
@@ -1356,10 +1376,12 @@
 		              $qresult=~s/\&$//;
                               print $client "$qresult\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # -------------------------------------------------------------------- chatsend
                    } elsif ($userinput =~ /^chatsend/) {
@@ -1398,7 +1420,8 @@
 			   print $client "ok\n";
 		       }
 		       else {
-			   print $client "error:$!\n";
+			   print $client "error: ".($!+0)
+			       ." IO::File->new Failed\n";
 		       }
 # ----------------------------------------------------------------------- idput
                    } elsif ($userinput =~ /^idput/) {
@@ -1422,10 +1445,12 @@
 			   if (untie(%hash)) {
                               print $client "ok\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ----------------------------------------------------------------------- idget
                    } elsif ($userinput =~ /^idget/) {
@@ -1443,10 +1468,12 @@
 		              $qresult=~s/\&$//;
                               print $client "$qresult\n";
                            } else {
-                              print $client "error:$!\n";
+                              print $client "error: ".($!+0)
+				  ." untie(GDBM) Failed\n";
                            }
                        } else {
-                           print $client "error:$!\n";
+                           print $client "error: ".($!+0)
+			       ." tie(GDBM) Failed\n";
                        }
 # ---------------------------------------------------------------------- tmpput
                    } elsif ($userinput =~ /^tmpput/) {
@@ -1463,7 +1490,8 @@
 			   print $client "$id\n";
 		       }
 		       else {
-			   print $client "error:$!\n";
+			   print $client "error: ".($!+0)
+			       ."IO::File->new Failed\n";
 		       }
 
 # ---------------------------------------------------------------------- tmpget
@@ -1479,7 +1507,8 @@
                            close $store;
 		       }
 		       else {
-			   print $client "error:$!\n";
+			   print $client "error: ".($!+0)
+			       ."IO::File->new Failed\n";
 		       }
 
 # -------------------------------------------------------------------------- ls

--foxr1046492302--