Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 290483 Details for
Bug 426898
hp-sendfax hangs forever
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to set correct fax temp directory
hplip-faxtempdir.patch (text/plain), 3.71 KB, created by
Wart
on 2007-12-28 06:53:53 UTC
(
hide
)
Description:
Patch to set correct fax temp directory
Filename:
MIME Type:
Creator:
Wart
Created:
2007-12-28 06:53:53 UTC
Size:
3.71 KB
patch
obsolete
>diff -urNad hplip-2.7.7.dfsg.1~/prnt/hpijs/hpijsfax.cpp hplip-2.7.7.dfsg.1/prnt/hpijs/hpijsfax.cpp >--- hplip-2.7.7.dfsg.1~/prnt/hpijs/hpijsfax.cpp 2007-03-21 17:39:25.000000000 +0000 >+++ hplip-2.7.7.dfsg.1/prnt/hpijs/hpijsfax.cpp 2007-10-27 13:06:44.000000000 +0100 >@@ -261,10 +261,8 @@ > IP_IMAGE_TRAITS traits; > IP_HANDLE hJob; > >- char hpFileName[256]; >- FILE *fpFax = NULL; >- struct timeval tv; >- struct tm *cur_time; >+ char hpFileName[] = "/tmp/hplipfaxXXXXXX"; >+ int fdFax = -1; > BYTE szFileHeader[68]; > BYTE szPageHeader[64]; > BYTE *p; >@@ -293,14 +291,6 @@ > ijs_server_install_set_cb (ctx, hpijsfax_set_cb, pFaxStruct); > ijs_server_install_get_cb (ctx, hpijsfax_get_cb, pFaxStruct); > >- memset (&tv, 0, sizeof (tv)); >- gettimeofday (&tv, NULL); >- cur_time = localtime (&tv.tv_sec); >- memset (hpFileName, 0, 256); >- sprintf (hpFileName, "%s/hplipfax%d%d%d%d%d%d.g3", getenv ("TMPDIR"), >- cur_time->tm_year+1900, cur_time->tm_mon+1, cur_time->tm_mday, >- cur_time->tm_hour, cur_time->tm_min, cur_time->tm_sec); >- > while (1) > { > if ((ret = ijs_server_get_page_header(ctx, &pFaxStruct->ph)) < 0) >@@ -312,10 +302,10 @@ > if (pFaxStruct->IsFirstRaster ()) > { > pFaxStruct->SetFirstRaster (0); >- if (fpFax == NULL) >+ if (fdFax == -1) > { >- fpFax = fopen (hpFileName, "w"); >- if (fpFax == NULL) >+ fdFax = mkstemp (hpFileName); >+ if (fdFax < 0) > { > bug ("Unable to open Fax output file - %s for writing\n", hpFileName); > goto BUGOUT; >@@ -334,7 +324,7 @@ > *p++ = pFaxStruct->GetFaxEncoding (); // MH, MMR or JPEG > p += 4; // Reserved 1 > p += 4; // Reserved 2 >- fwrite (szFileHeader, 1, p - szFileHeader, fpFax); >+ write (fdFax, szFileHeader, (p - szFileHeader)); > } > } > >@@ -488,8 +478,8 @@ > HPLIPPUTINT32 (p, dwOutputUsed); p += 4; // Size in bytes of encoded data > HPLIPPUTINT32 (p, 0); p += 4; // Thumbnail data size > HPLIPPUTINT32 (p, 0); p += 4; // Reserved for future use >- fwrite (szPageHeader, 1, (p - szPageHeader), fpFax); >- fwrite (pbOutputBuf, 1, dwOutputUsed, fpFax); >+ write (fdFax, szPageHeader, (p - szPageHeader)); >+ write (fdFax, pbOutputBuf, dwOutputUsed); > /* > * Write the thumbnail data here > */ >@@ -505,35 +495,23 @@ > > } /* end while (1) */ > >- fseek (fpFax, 9, SEEK_SET); >+ lseek (fdFax, 9, SEEK_SET); > HPLIPPUTINT32 ((szFileHeader + 9), uiPageNum); >- fwrite (szFileHeader + 9, 1, 4, fpFax); >+ write (fdFax, szFileHeader + 9, 4); > /* > chmod (hpFileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); > hpFileName[strlen (hpFileName)] = '\n'; > write (pFaxStruct->iOutputPath, hpFileName, strlen (hpFileName)); > */ >- fclose (fpFax); >- >-/* >- * Reopen the fax output file and write the data to fax backend. >- * Have to do this because the fax header includes number of pages in the >- * job, so, have to wait until all pages have been received. >- */ > > BYTE *pTmp; > int iSize; >+ pTmp = NULL; > >- fpFax = fopen (hpFileName, "r"); >- if (!fpFax) >- { >- goto BUGOUT; >- } >- >- fseek (fpFax, 0, SEEK_END); >- iSize = ftell (fpFax); >- fseek (fpFax, 0, SEEK_SET); >+ iSize = lseek (fdFax, 0, SEEK_END); >+ lseek (fdFax, 0, SEEK_SET); > >+ if (iSize > 0) > pTmp = new BYTE[iSize]; > if (pTmp == NULL) > { >@@ -544,18 +522,16 @@ > goto BUGOUT; > } > } >- while (iSize > 0) >+ while ((i = read (fdFax, pTmp, iSize)) > 0) > { >- i = fread (pTmp, 1, iSize, fpFax); > write (pFaxStruct->iOutputPath, pTmp, i); >- iSize -= i; > } > delete [] pTmp; > > BUGOUT: >- if (fpFax) >+ if (fdFax > 0) > { >- fclose (fpFax); >+ close (fdFax); > } > //unlink (hpFileName); > if (pFaxStruct != NULL)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 426898
: 290483