LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 898|回复: 0

turbolinux fork 编程与red hat linux 有什么区别么

[复制链接]
发表于 2005-7-14 15:32:56 | 显示全部楼层 |阅读模式
小弟不才:
   以下代码red hat 运行一年多没问题:
===============================
init_daemon();
while(1)
{
   sleep(1);
   ftpOperation();
   chmodOperation();
   updateData();
   @arrUpdate = ();
}

sub ftpOperation
{
   my $sqlFtp= "SELECT A.Flag,A.UserName,A.Password,B.StrudioCode FROM  DEG_FTP_USER A LEFT JOIN DEG_STRUDIO B ON";
   $sqlFtp .=  " SUBSTRING(A.UserName,2,LENGTH(A.UserName)-1) =B.StrudioCode WHERE A.Flag in (0,1,3)";
   $sth = $dbh->prepare($sqlFtp);
   $sth->execute();
   while(my $data = $sth->fetchrow_hashref())
   {
  。。。。。。。。。。。。。。。
========================================
最近客户将代码移植到TurboLinux下
运行出错:
=======================================
DBD::mysql::st fetchrow_hashref failed: fetch()without execute() at deamonFtp.pl line 34.
=======================================
后将init_daemon();注释掉,执行通过。。。。
==================================
sub init_daemon
{
my $pid;
   my $i;
   if($pid=fork())
   {
          exit(0);
   }
   elsif($pid< 0)
   {
          exit(1);
   }
   if($pid=fork())
   {
       exit(0);
   }
   elsif($pid< 0)
   {
       exit(1);
   }

}
===================================
请教各位,到底是哪里出错了.................
还有
我在shell下使用useradd ,userdel命令提示错误(TurboLinux下)
以上谢谢指教。。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表