src/lib/message.c
void init_console_msg(const char *wd)
{
   int fd;

   bsnprintf(con_fname, sizeof(con_fname), "%s%c%s.conmsg", wd, PathSeparator, my_name);
   fd = open(con_fname, O_CREAT|O_RDWR|O_BINARY, 0600);
   if (fd == -1) {
      berrno be;
      Emsg2(M_ERROR_TERM, 0, _("Could not open console message file %s: ERR=%s\n"),
          con_fname, be.bstrerror());
   }
   if (lseek(fd, 0, SEEK_END) > 0) {
      console_msg_pending = true;
   }
   close(fd);
   con_fd = bfopen(con_fname, "a+b");
   if (!con_fd) {
      berrno be;
      Emsg2(M_ERROR, 0, _("Could not open console message file %s: ERR=%s\n"),
          con_fname, be.bstrerror());
   }
   if (rwl_init(&con_lock) != 0) {
      berrno be;
      Emsg1(M_ERROR_TERM, 0, _("Could not get con mutex: ERR=%s\n"),
         be.bstrerror());
   }
}
/* Initialize so that the console (User Agent) can
 * receive messages -- stored in a file.
 */
Initialize so that the console (User Agent) can
receive messages -- stored in a file.
Initialize so that the console ( User Agent ) can receive messages -- stored in a file .
void init_console_msg(const char *wd)
{
   int fd;
   bsnprintf(con_fname, sizeof(con_fname), "%s%c%s.conmsg", wd, PathSeparator, my_name);
   fd = open(con_fname, O_CREAT|O_RDWR|O_BINARY, 0600);
   if (fd == -1) {
      berrno be;
      Emsg2(M_ERROR_TERM, 0, _("Could not open console message file %s: ERR=%s\n"),
          con_fname, be.bstrerror());
   }
   if (lseek(fd, 0, SEEK_END) > 0) {
      console_msg_pending = true;
   }
   close(fd);
   con_fd = bfopen(con_fname, "a+b");
   if (!con_fd) {
      berrno be;
      Emsg2(M_ERROR, 0, _("Could not open console message file %s: ERR=%s\n"),
          con_fname, be.bstrerror());
   }
   if (rwl_init(&con_lock) != 0) {
      berrno be;
      Emsg1(M_ERROR_TERM, 0, _("Could not get con mutex: ERR=%s\n"),
         be.bstrerror());
   }
}
void init_console_msg ( const char * wd ) { int fd ; bsnprintf ( con_fname , sizeof ( con_fname ) , " " , wd , PathSeparator , my_name ) ; fd = open ( con_fname , O_CREAT | O_RDWR | O_BINARY , 0600 ) ; if ( fd == -1 ) { berrno be ; Emsg2 ( M_ERROR_TERM , 0 , _ ( " \n " ) , con_fname , be . bstrerror ( ) ) ; } if ( lseek ( fd , 0 , SEEK_END ) > 0 ) { console_msg_pending = true ; } close ( fd ) ; con_fd = bfopen ( con_fname , " " ) ; if ( ! con_fd ) { berrno be ; Emsg2 ( M_ERROR , 0 , _ ( " \n " ) , con_fname , be . bstrerror ( ) ) ; } if ( rwl_init ( & con_lock ) != 0 ) { berrno be ; Emsg1 ( M_ERROR_TERM , 0 , _ ( " \n " ) , be . bstrerror ( ) ) ; } }
Initialize so that the console (User Agent) can
 receive messages -- stored in a file.
Initialize so that the console ( User Agent ) can receive messages -- stored in a file .